package com.its.vms.domain.enums;

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

public enum eVmsDownload {

    vms_download_disable (0, "0.disable"),
    vms_download_enable  (1, "1.enable");

    private final int value;
    private final String string;

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

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

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

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

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