package com.beanit.asn1dsrc.enums;

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

public enum  eReject {

    RejectType_PR_NOTHING     (0x00, "RejectType_PR_NOTHING"),	/* No components present */
    RejectType_PR_Login       (0x01, "RejectType_PR_Login"),
    RejectType_PR_Subscription(0x02, "RejectType_PR_Subscription"),
    RejectType_PR_Publication (0x03, "RejectType_PR_Publication");

    private final int value;
    private final String string;

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

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

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