eVmsReqBoardPower.java 966 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.its.vms.domain.enums;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. public enum eVmsReqBoardPower {
  5. vms_req_board_power_off (0x00, "0.off"),
  6. vms_req_board_power_on (0x01, "1.on");
  7. private final int value;
  8. private final String string;
  9. private static final Map<Integer, eVmsReqBoardPower> map;
  10. static {
  11. map = new HashMap<>();
  12. for (eVmsReqBoardPower e : values()) {
  13. map.put(e.value, e);
  14. }
  15. }
  16. public static eVmsReqBoardPower getValue(int value) {
  17. return map.get(value);
  18. }
  19. public static eVmsReqBoardPower getValue(byte value) {
  20. int intValue = (value & 0xFF);
  21. return map.get(intValue);
  22. }
  23. eVmsReqBoardPower(int value, String string) {
  24. this.value = value;
  25. this.string = string;
  26. }
  27. public int getValue() {
  28. return this.value;
  29. }
  30. @Override
  31. public String toString() {
  32. return this.string;
  33. }
  34. }