package cn.superdesk.uniorder.common.enums.accounting;


import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 7/15/20 5:51 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 7/15/20 5:51 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum AccountingOrderIsSendEmailEnum {

//	是否发邮件0-不发,1-发

	未发送(0, "未发送"),
	已发送(1, "已发送"),
	;

	private Integer key;
	private String  desc;

	AccountingOrderIsSendEmailEnum(Integer key, String desc) {
		this.key = key;
		this.desc = desc;
	}

	public Integer getKey() {
		return key;
	}

	public String getDesc() {
		return desc;
	}


	public static String getDesc(Integer key) {
		for (AccountingOrderIsSendEmailEnum c : AccountingOrderIsSendEmailEnum.values()) {
			if (c.key.equals(key)) {
				return c.getDesc();
			}
		}
		return null;
	}

	private static final Map<Integer, AccountingOrderIsSendEmailEnum> LOOKUP = new HashMap<>();

	static {
		for (AccountingOrderIsSendEmailEnum s : EnumSet.allOf(AccountingOrderIsSendEmailEnum.class)) {
			LOOKUP.put(s.getKey(), s);
		}
	}

	public static AccountingOrderIsSendEmailEnum get(Integer key) {
		return LOOKUP.get(key);
	}
}
