package com.beanit.asn1dsrc.enums;

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

public enum eRejectLogin {

    Reject_Login_cd_other              (0, "Reject_Login_cd_other"),
    Reject_Login_cd_unknownDomainName  (1, "Reject_Login_cd_unknownDomainName"),
    Reject_Login_cd_accessDenied       (2, "Reject_Login_cd_accessDenied"),
    Reject_Login_cd_invalidNamePassword(3, "Reject_Login_cd_invalidNamePassword"),
    Reject_Login_cd_timeoutTooSmall    (4, "Reject_Login_cd_timeoutTooSmall"),
    Reject_Login_cd_timeoutTooLarge    (5, "Reject_Login_cd_timeoutTooLarge"),
    Reject_Login_cd_heartbeatTooSmall  (6, "Reject_Login_cd_heartbeatTooSmall"),
    Reject_Login_cd_heartbeatTooLarge  (7, "Reject_Login_cd_heartbeatTooLarge"),
    Reject_Login_cd_sessionExists      (8, "Reject_Login_cd_sessionExists"),
    Reject_Login_cd_maxSessionsReached (9, "Reject_Login_cd_maxSessionsReached");

    private final int value;
    private final String string;

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

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

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