package com.its.vms.domain.enums;

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

public enum eVmsReqControl {

    vms_req_control_signboard  ((byte)0x01, "0x01.signboard control"),
    vms_req_control_initialize ((byte)0x02, "0x02.initialize(reset)"),
    vms_req_control_luminance  ((byte)0x06, "0x03.luminance control");

    private final byte value;
    private final String string;

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

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

    eVmsReqControl(byte value, String string) {
        this.value  = value;
        this.string = string;
    }

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

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