package cn.superdesk.uniorder.common.enums.thirdpart.jd;

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

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2020/12/21 下午7:19
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020/12/21 下午7:19
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum SysQuartzScheduleTaskStatementOfAccountIsPauseEnum {

	启用(0, "启用"),
	暂停(1, "暂停"),

	;

	private Integer key;
	private String  desc;

	SysQuartzScheduleTaskStatementOfAccountIsPauseEnum(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 (SysQuartzScheduleTaskStatementOfAccountIsPauseEnum c : SysQuartzScheduleTaskStatementOfAccountIsPauseEnum.values()) {
			if (c.key.equals(key)) {
				return c.getDesc();
			}
		}
		return null;
	}

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

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

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