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

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

public enum eVmsDoorStts {

    DOOR_STTS_OPEN    (0x00, "0x00.door_stts_open"),
    DOOR_STTS_CLOSE   (0x01, "0x01.door_stts_close"),
    DOOR_STTS_UNKNOWN (0x09, "0x09.door_stts_unknown");

    private final int value;
    private final String string;

    private static final Map<Integer, eVmsDoorStts> map;
    static {
        map = new HashMap<>();
        for (eVmsDoorStts e : values()) {
            map.put(e.value, e);
        }
    }
    public static eVmsDoorStts getByValue(int value) {
        return map.get(value);
    }
    public static eVmsDoorStts getByValue(byte value) {
        int intValue = value & 0x0F;
        return map.get(intValue);
    }

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

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

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