package com.tsi.app.common.cpu.enums;

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

public enum eTimeReliability {

    FIXED_TIMING    (0, "FIXED_TIMING"),        //고정신호시간
    VARIABLE_TIMING (1, "VARIABLE_TIMING");     //가변신호시간

    private final int value;
    private final String string;

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

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

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