eObjectId.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.beanit.enums;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. public enum eObjectId {
  5. OBJ_CurrentLinkState (111, "OBJ_CurrentLinkState"), /* 교통소통정보 */
  6. OBJ_EventIdentity (112, "OBJ_EventIdentity"), /* 교통통제정보 */
  7. OBJ_IncidentIdentity (113, "OBJ_IncidentIdentity"), /* 돌발상황발생정보 */
  8. OBJ_IncidentConditions (114, "OBJ_IncidentConditions"), /* 돌발상황정보 */
  9. OBJ_RoadwaySurfaceStatus (115, "OBJ_RoadwaySurfaceStatus"), /* 도로상태정보 */
  10. OBJ_WeatherInformation (116, "OBJ_WeatherInformation"), /* 기상정보 */
  11. OBJ_LinkRoadwayGeometry (117, "OBJ_LinkRoadwayGeometry"), /* 도로관리정보 */
  12. OBJ_ProbeVehicleDetection (118, "OBJ_ProbeVehicleDetection"), /* 도로관리정보 */
  13. OBJ_DetectorCollection (119, "OBJ_DetectorCollection"); /* 수집, 최근 OBU 트랜잭션 수집정보 */
  14. private final int value;
  15. private final String string;
  16. private static final Map<Integer, eObjectId> map;
  17. static {
  18. map = new HashMap<>();
  19. for (eObjectId e : values()) {
  20. map.put(Integer.valueOf(e.value), e);
  21. }
  22. }
  23. public static eObjectId getByValue(int value) {
  24. return map.get(Integer.valueOf(value));
  25. }
  26. public static eObjectId getByValue(byte value) {
  27. int intValue = (int)(value & 0x0F);
  28. return map.get(Integer.valueOf(intValue));
  29. }
  30. eObjectId(int value, String string) {
  31. this.value = value;
  32. this.string = string;
  33. }
  34. public int getValue() {
  35. return this.value;
  36. }
  37. public String toString() {
  38. return this.string;
  39. }
  40. }