package com.zy.core.enums; import com.core.common.Cools; public enum ShuttleChargeType { CHARGE_1(1, "1000402", "0700402"), CHARGE_2(2, "1000403", "0700403"), ; ShuttleChargeType(int id, String locNo,String waitLocNo) { this.id = id; this.locNo = locNo; this.waitLocNo = waitLocNo; } public int id; public String locNo; public String waitLocNo; public static ShuttleChargeType get(String locNo) { if (Cools.isEmpty(locNo)) { return null; } ShuttleChargeType[] values = ShuttleChargeType.values(); for (ShuttleChargeType value : values) { if (value.locNo.equals(locNo)) { return value; } } return null; } public static ShuttleChargeType get(int id) { if (Cools.isEmpty(id)) { return null; } ShuttleChargeType[] values = ShuttleChargeType.values(); for (ShuttleChargeType value : values) { if (value.id == id) { return value; } } return null; } }