package com.qianwen.mdc.collect.enums; public enum WorkstationParamTypeEnum { OTHER(0, "其他"), STATE(1, "状态"), OUTPUT(2, "产量"), /** * 3-ALARM */ ALARM(3, "报警"), PROGRAMNUM(4, "程序号"), PULSE_OUTPUT(5, "脉冲产量"), ALARM_NO(6, "报警号"), ALARM_MSG(7, "报警信息"), COUNT(8, "计数"), PLUSE(9, "脉冲"); private final Integer type; private final String description; WorkstationParamTypeEnum(final Integer type, final String description) { this.type = type; this.description = description; } public Integer getType() { return this.type; } public String getDescription() { return this.description; } public static WorkstationParamTypeEnum of(Integer messageType) { if (messageType == null) { return null; } WorkstationParamTypeEnum[] values = values(); for (WorkstationParamTypeEnum messageEnum : values) { if (messageEnum.type.equals(messageType)) { return messageEnum; } } return null; } public boolean isEqual(Integer type) { return this.type.equals(type); } }