package org.springblade.enums;

public enum RtuKindEnum {

	/**
	 * 降水
	 */
	RTU_RAIN("1", "降水"),

	/**
	 * 河道
	 */
	RTU_RIVER("2", "河道"),

	/**
	 * 水库(湖泊)
	 */
	RTU_RESERVOIR("3", "水库(湖泊)"),

	/**
	 * 闸坝
	 */
	RTU_BARRAGE("4", "闸坝"),

	/**
	 * 泵站
	 */
	RTU_PUMP_SITE("5", "泵站"),

	/**
	 * 潮汐
	 */
	RTU_TIDE("6", "潮汐"),

	/**
	 * 墒情
	 */
	RTU_GROUND_SITE("7", "墒情"),

	/**
	 * 地下水
	 */
	RTU_GROUND_WATER("8", "地下水"),

	/**
	 * 水质
	 */
	RTU_WATER_QUALITY("9", "水质"),

	/**
	 * 取水口
	 */
	RTU_WATER_INTAKE("10", "取水口"),

	/**
	 * 排水口
	 */
	RTU_WATER_OUTLET("11", "排水口");

	private String code;

	private String name;

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

	/**
	 * Function:根据code来获取对应的name
	 * Author: Admin
	 * Date:2021/6/26
	 *
	 * @param code
	 * @return java.lang.String
	 * @throws Exception
	 */
	public static String getName(String code) {
		for (RtuKindEnum type : RtuKindEnum.values()) {
			if (type.code.equals(code)) {
				return type.name;
			}
		}
		return "";
	}

	/**
	 * Function:根据code来获取对应的枚举常量
	 * Author: Admin
	 * Date:2021/6/26
	 *
	 * @param code
	 * @return com.zhgzjg.web.enums.DeleteFlag
	 * @throws Exception
	 */
	public static RtuKindEnum getEnumByCode(String code) {
		for (RtuKindEnum type : RtuKindEnum.values()) {
			if (type.code.equals(code)) {
				return type;
			}
		}
		return null;
	}


	/**
	 * Function:根据name来获取对应的枚举常量
	 * Author: Admin
	 * Date:2021/6/26
	 *
	 * @param name
	 * @return com.zhgzjg.web.enums.DeleteFlag
	 * @throws Exception
	 */
	public static RtuKindEnum getEnumByName(String name) {
		for (RtuKindEnum type : RtuKindEnum.values()) {
			if (type.name.equals(name)) {
				return type;
			}
		}
		return null;
	}


	public String getCode() {
		return code;
	}

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

	public String getName() {
		return name;
	}

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