package com.its.vms.xnettcp.vms.protocol.enums;

import java.util.HashMap;
import java.util.Map;

public enum eVmsFormObjectKind {

    OBJECT_TEXT      ( 0x00, "0x00.문자열"),
    OBJECT_BITMAP    ( 0x01, "0x01.Bitmap"),
    OBJECT_BITMAP_ID ( 0x02, "0x02.Bitmap ID");

    private final int value;
    private final String string;

    private static final Map<Integer, eVmsFormObjectKind> map;
    static {
        map = new HashMap<>();
        for (eVmsFormObjectKind e : values()) {
            map.put(e.value, e);
        }
    }

    public static eVmsFormObjectKind getValue(int value) {
        return map.get(value);
    }
    public static eVmsFormObjectKind getValue(byte value) {
        int intValue = (value & 0x0F);
        return map.get(intValue);
    }

    eVmsFormObjectKind(int value, String string) {
        this.value  = value;
        this.string = string;
    }

    public int getValue() {
        return this.value;
    }

    @Override
    public String toString() {
        return this.string;
    }
}
