package com.beanit.asn1dsrc.enums;

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

public enum eRejectPublication {

    Reject_Publication_cd_other                       (0, "Reject_Publication_cd_other"),
    Reject_Publication_cd_unknownSubscription         (1, "Reject_Publication_cd_unknownSubscription"),
    Reject_Publication_cd_unknownPublicationNbr       (2, "Reject_Publication_cd_unknownPublicationNbr"),
    Reject_Publication_cd_invalidPublishFormat        (3, "Reject_Publication_cd_invalidPublishFormat"),
    Reject_Publication_cd_unknownPublicationMsgId     (4, "Reject_Publication_cd_unknownPublicationMsgId"),
    Reject_Publication_cd_invalidPublicationMsgId     (5, "Reject_Publication_cd_invalidPublicationMsgId"),
    Reject_Publication_cd_invalidPublicationMsgContent(6, "Reject_Publication_cd_invalidPublicationMsgContent"),
    Reject_Publication_cd_repeatedPublicationNbr      (7, "Reject_Publication_cd_repeatedPublicationNbr");
    private final int value;
    private final String string;

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

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

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