package com.its.vms.domain.enums;

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

public enum eVmsSendResult {

    send_result_fail (0, "0.실패"),
    send_result_succ (1, "1.성공");

    private final int value;
    private final String string;

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

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

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

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

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