package com.zy.core.enums; import com.core.common.Cools; public enum ShuttleChargeType { CHARGE_1(1, "1402001"), CHARGE_2(2, "1402002"), CHARGE_3(3, "1402003"), CHARGE_4(4, "1402004"), CHARGE_5(5, "1601905"), CHARGE_6(6, "1601906"), CHARGE_7(7, "1601907"), CHARGE_8(8, "1302008"), CHARGE_9(9, "1302009"), CHARGE_10(10, "1302010") ; ShuttleChargeType(int id, String locNo) { this.id = id; this.locNo = locNo; } public int id; public String locNo; 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; } }