package com.beanit.asn1dsrc.enums;

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

public enum eRejectSubscription {

    Reject_Subscription_cd_other                     (0, "Reject_Subscription_cd_other"),
    Reject_Subscription_cd_unknownSubscriptionNbr    (1, "Reject_Subscription_cd_unknownSubscriptionNbr"),
    Reject_Subscription_cd_invalidTimes              (2, "Reject_Subscription_cd_invalidTimes"),
    Reject_Subscription_cd_frequencyTooSmall         (3, "Reject_Subscription_cd_frequencyTooSmall"),
    Reject_Subscription_cd_frequencyTooLarge         (4, "Reject_Subscription_cd_frequencyTooLarge"),
    Reject_Subscription_cd_invalid_mode              (5, "Reject_Subscription_cd_invalid_mode"),
    Reject_Subscription_cd_publishFormatNotSupported (6, "Reject_Subscription_cd_publishFormatNotSupported"),
    Reject_Subscription_cd_unknownSubscriptionMsgId  (7, "Reject_Subscription_cd_unknownSubscriptionMsgId"),
    Reject_Subscription_cd_invalidSubscriptionMsgId  (8, "Reject_Subscription_cd_invalidSubscriptionMsgId"),
    Reject_Subscription_cd_invalidSubscriptionContent(9, "Reject_Subscription_cd_invalidSubscriptionContent");

    private final int value;
    private final String string;

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

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

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