一次性加载枚举

yun-zuoyi
gragon.xu 7 years ago
parent 9ad28091fa
commit c1e1a87333

@ -15,7 +15,7 @@ public class WmsEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum IS_FREE {
CHARGING(0, "计费"), GRATIS(1, "免费");
CHARGING(1, "计费"), GRATIS(2, "免费");
private int value;
private String description;
@ -1283,9 +1283,37 @@ public class WmsEnumUtil {
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TRUE_OR_FALSE {
CHARGING(1, "是"), GRATIS(2, "否");
private int value;
private String description;
TRUE_OR_FALSE(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
@Override
public String toString() {
return super.toString();
public String getDescription() {
return description;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
}

Loading…
Cancel
Save