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

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

public enum eVmsFanRunMode {

    FAN_RUN_OFF    (0x00, "0x00.fan_run_off"),
    FAN_RUN_ON     (0x01, "0x01.fan_run_on"),
    FAN_RUN_AUTO   (0x02, "0x02.fan_run_auto"),
    FAN_RUN_MANUAL (0x03, "0x03.fan_run_manual");

    private final int value;
    private final String string;

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

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

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

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