package com.its.vms.domain.enums;

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

public enum eVmsDownloadStep {

    send_wait     (0, "0.대기"),
    send_progress (1, "1.전송중"),
    send_complete (2, "2.전송완료");

    private final int value;
    private final String string;

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

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

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

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

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