根据以下内容创建java枚举,枚举类名为ORDER_TYPE,枚举包含code和name两个熟悉
时间: 2024-05-19 08:16:14 浏览: 83
public enum ORDER_TYPE {
NEW(1, "新订单"),
PROCESSING(2, "处理中"),
SHIPPED(3, "已发货"),
DELIVERED(4, "已送达"),
CANCELLED(5, "已取消");
private final int code;
private final String name;
ORDER_TYPE(int code, String name) {
this.code = code;
this.name = name;
}
public int getCode() {
return code;
}
public String getName() {
return name;
}
}
阅读全文