package com.zy.core.netty.constant; public enum FireDataType { HEARTBEAT(0x36, 0x39, "心跳信息"), FIRE_ALARM(0x38, 0x30, "火警"), ; public int byte1; public int byte2; public String des; FireDataType(int byte1, int byte2, String des) { this.byte1 = byte1; this.byte2 = byte2; this.des = des; } public static FireDataType get(int byte1, int byte2) { for (FireDataType value : FireDataType.values()) { if (byte1 == value.byte1 && byte2 == value.byte2) { return value; } } return null; } }