package com.its.vms.domain.enums;

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

public enum eVmsReqBoardPower {

    vms_req_board_power_off ((byte)0, "0.off"),
    vms_req_board_power_on  ((byte)1, "1.on");

    private final byte value;
    private final String string;

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

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

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

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

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