package com.beanit.asn1dsrc.enums;

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

public enum eWorkMode {

    WorkMode_Stop       (0, "WorkMode_Stop"),           //동작 중지
    WorkMode_Start      (1, "WorkMode_Start"),          //동작 시작
    WorkMode_ManageStart(2, "WorkMode_ManageStart");    //유지보수 동작 시작

    private final int value;
    private final String string;

    private static final Map<Integer, eWorkMode> map;
    static {
        map = new HashMap<>();
        for (eWorkMode e : values()) {
            map.put(Integer.valueOf(e.value), e);
        }
    }
    public static eWorkMode getByValue(int value) {
        return map.get(Integer.valueOf(value));
    }
    public static eWorkMode getByValue(byte value) {
        int intValue = (int)(value & 0x0F);
        return map.get(Integer.valueOf(intValue));
    }

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

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