package com.its.vds.xnettcp.vds.protocol.enums;

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

public enum eVdsBitEnable {

    BIT_DISABLE (0x00, "0x00.Disable"),
    BIT_ENABLE  (0x01, "0x01.Enable");

    private final int value;
    private final String string;

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

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

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

    public int getValue() {
        return this.value;
    }
    public byte getByteValue() {
        return (byte)(this.value & 0xFF);
    }

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