package com.zy.core.enums; public enum JarStatusType { IDLE(0, "空闲"), MOVING(1, "入料中"), SOS(2, "硫化中"), WAITING1(3, "出料中"), WAITING2(4, "硫化完成"), WAITING3(5, "进料门打开中"), WAITING4(6, "出料门打开中"), WAITING5(7, "进料门关闭中"), OFF_LINE(8, "出料门关闭中"), OTHER(100, "其它"), ; public Integer id; public String desc; JarStatusType(Integer id, String desc) { this.id = id; this.desc = desc; } public static JarStatusType get(Short id) { if (null == id) { return null; } for (JarStatusType type : JarStatusType.values()) { if (type.id.equals(id.intValue())) { return type; } } return OFF_LINE; } public static JarStatusType get(JarStatusType type) { if (null == type) { return null; } for (JarStatusType jarStatusType : JarStatusType.values()) { if (jarStatusType == type) { return jarStatusType; } } return null; } }