| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package com.goafanti.order.enums;
- import java.util.HashMap;
- import java.util.Map;
- public enum IntentionSate {
- /** 待卖方确认 **/
- WAIT_SELLER_CONFIRM(0,"WAIT_SELLER_CONFIRM"),
- /** 卖方已确认 **/
- SELLER_CONFIRM(1,"SELLER_CONFIRM"),
- /** 卖方已拒绝 **/
- SELLER_REFUSE(2,"SELLER_REFUSE"),
- /** 买方已取消 **/
- BUYER_CANCELLED(3,"BUYER_CANCELLED"),
- /** 已过期 **/
- EXPIRED(4,"EXPIRED"),
- /** 无效 **/
- INVALID(10, "INVALID");
-
- private IntentionSate(Integer code, String desc) {
- this.code = code;
- this.desc = desc;
- }
- private static Map<Integer, IntentionSate> status = new HashMap<Integer, IntentionSate>();
- static {
- for (IntentionSate value : IntentionSate.values()) {
- status.put(value.getCode(), value);
- }
- }
- public static IntentionSate getStatus(Integer code) {
- if (containsType(code)) {
- return status.get(code);
- }
- return INVALID;
- }
- public static boolean containsType(Integer code) {
- return status.containsKey(code);
- }
-
- private Integer code;
- private String desc;
- public Integer getCode() {
- return code;
- }
- public void setCode(Integer code) {
- this.code = code;
- }
- public String getDesc() {
- return desc;
- }
- public void setDesc(String desc) {
- this.desc = desc;
- }
- }
|