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

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

public enum eVmsFanStts {

    FAN_STTS_RUN     (0x00, "0x00.fan_stts_run"),
    FAN_STTS_STOP    (0x01, "0x01.fan_stts_stop"),
    FAN_STTS_UNKNOWN (0x09, "0x09.fan_stts_unknown");

    private final int value;
    private final String string;

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

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

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

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