package com.beanit.asn1dsrc.enums;

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

public enum eObjectId {

    OBJ_CurrentLinkStateRoadSide           (401, "OBJ_CurrentLinkStateRoadSide"),             /* 제공, 교통소통정보 */
    OBJ_EventIdentityRoadSide              (402, "OBJ_EventIdentityRoadSide"),                /* 제공, 교통통제정보 */
    OBJ_IncidentConditionsRoadSide         (403, "OBJ_IncidentConditionsRoadSide"),           /* 제공, 돌발상황정보 */
    OBJ_RoadwayConditionsRoadSide          (404, "OBJ_RoadwayConditionsRoadSide"),            /* 제공, 도로상태정보 */
    OBJ_WeatherInformationRoadSide         (405, "OBJ_WeatherInformationRoadSide"),           /* 제공, 기상정보 */
    OBJ_ProbeVehicleDetectionRoadSide      (406, "OBJ_ProbeVehicleDetectionRoadSide"),        /* 수집, 프로브정보 */
    OBJ_ControlDevice                      (407, "OBJ_ControlDevice"),                        /* 제공, 제어정보 */
    OBJ_MultiMediaData                     (501, "OBJ_MultiMediaData"),                       /* 제공, 멀티미디어 데이터 */
    OBJ_OBUBasicInfo                       (801, "OBJ_OBUBasicInfo"),                         /* 수집, OBU 기본정보 */
    OBJ_RecentETCOBUTransactionInfo        (802, "OBJ_RecentETCOBUTransactionInfo"),          /* 수집, 최근 ETC OBU 트랜잭션 정보*/
    OBJ_TrafficInfoOBUBasicInfo            (803, "OBJ_TrafficInfoOBUBasicInfo"),              /* 수집, OBU 기본정보 */
    OBJ_TrafficInfoDSRCCurrentSpotState    (804, "OBJ_TrafficInfoDSRCCurrentSpotState"),      /* 수집, 가상지점 수집정보 */
    OBJ_TrafficInfoRecentOBUTransactionInfo(805, "OBJ_TrafficInfoRecentOBUTransactionInfo"),  /* 수집, 최근 OBU 트랜잭션 정보 */
    OBJ_TrafficInfoDSRCSpotStateReq        (806, "OBJ_TrafficInfoDSRCSpotStateReq"),          /* 수집, 가상수집지점 요청정보 */
    OBJ_TrafficInfoETCTransactionInfo      (807, "OBJ_TrafficInfoETCTransactionInfo"),        /* 수집, 최근 ETC 트랜잭션 정보 */
    OBJ_OBUGatherInfo                      (808, "OBJ_OBUGatherInfo"),                        /* 수집, OBU 수집정보 */
    OBJ_DSRCIndividualCurrentSpotState     (809, "OBJ_DSRCIndividualCurrentSpotState"),       /* 수집, 개별단말수집지점 정보 */
    OBJ_DSRCRecentETCOBUTransactionInfo    (810, "OBJ_DSRCRecentETCOBUTransactionInfo"),      /* 수집, 최근 ETC OBU 트랜잭션 정보 */
    OBJ_DSRCRecentOBUTransactionInfo       (811, "OBJ_DSRCRecentOBUTransactionInfo");         /* 수집, 최근 OBU 트랜잭션 수집정보 */

    private final int value;
    private final String string;

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

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

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