package com.its.vms.domain.enums;

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

public enum eVmsControlResult {

    CTL_RESULT_SUCC (0, "0.성공"),
    CTL_RESULT_FAIL (1, "1.실패");

    private final int value;
    private final String string;

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

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

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

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

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