package com.its.vms.domain.enums;

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

public enum eVmsColor {
    color_black  ( 0, "0.검정색"),
    color_red    ( 1, "1.적색"),
    color_green  ( 2, "2.녹색"),
    color_amber  ( 3, "3.황색"),
    color_orange ( 4, "4.주황색(Orange)"),
    color_aqua   ( 5, "5.하늘색(Aqua)");

    private final int value;
    private final String string;

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

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

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

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

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