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

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

public enum eVmsHeaterStts {

    HEATER_STTS_RUN     (0x00, "0x00.heater_stts_run"),
    HEATER_STTS_STOP    (0x01, "0x01.heater_stts_stop"),
    HEATER_STTS_UNKNOWN (0x09, "0x09.heater_stts_unknown");

    private final int value;
    private final String string;

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

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

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

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