package com.beanit.asn1dsrc.enums;

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

public enum  eAccept {

    AcceptType_PR_NOTHING                (0x00, "AcceptType_PR_NOTHING"),	/* No components present */
    AcceptType_PR_logIn                  (0x01, "AcceptType_PR_logIn"),
    AcceptType_PR_single_subscription    (0x02, "AcceptType_PR_single_subscription"),
    AcceptType_PR_registered_subscription(0x03, "AcceptType_PR_registered_subscription"),
    AcceptType_PR_publication            (0x04, "AcceptType_PR_publication");

    private final int value;
    private final String string;

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

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

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