package com.its.vms.domain;

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

public enum eVmsFormObjectData {

    text_object_data      ( 0, "0:문자열"),
    graphic_object_data   ( 1, "1:이미지"),
    graphicID_object_data ( 2, "2:이미지 ID");

    private final int value;
    private final String string;

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

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

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

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