package com.yeejoin.amos.latentdanger.common.enums;

/**
 * 是否枚举
 * @author WJK
 *
 */
public enum YesOrNoEnum {

	NO("否","0"),
	YES("是","1" );


	/**
	 * 名称，描述
	 */
	private String name;
	/**
	 * 编码
	 */
	private String code;

	private YesOrNoEnum(String name, String code){
		this.name = name;
		this.code = code;
	}

	public static YesOrNoEnum getEnum(String code) {
		YesOrNoEnum jPushTypeEnum = null;
		for(YesOrNoEnum type: YesOrNoEnum.values()) {
			if (type.getCode().equals(code)) {
				jPushTypeEnum = type;
				break;
			}
		}

		return jPushTypeEnum;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

}
