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

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

public enum eVmsObjectBlinking {

    VMS_OBJECT_FIXED (0x00, "0x00.vms_object_fixed"),
    VMS_OBJECT_BLINK (0x01, "0x01.vms_object_blink");

    private final int value;
    private final String string;

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

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

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

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

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