package org.security.common.eum;

/**
 * @author zj 2022/4/11
 * 检查类型枚举
 */
public enum FrequencyEnum {
	/**
	 * 按天
	 */
	BY_DAY("byDay"),
	/**
	 * 按周
	 */
	BY_WEEK("byWeek"),
	/**
	 * 按月
	 */
	BY_MONTH("byMonth"),
	/**
	 * 按季度
	 */
	BY_QUARTER("byQuarter"),
	/**
	 * 按半年
	 */
	BY_HALFYEAR("byHalfYear"),
	/**
	 * 按年
	 */
	BY_YEAR("byYear"),
	/**
	 * 未知
	 */
	UNKNOW("");

	private String type;

	FrequencyEnum(String type) {
		this.type = type;
	}

	public static FrequencyEnum wrapper(String type) {
		FrequencyEnum[] values = FrequencyEnum.values();
		for (FrequencyEnum frequencyEnum : values) {
			if (frequencyEnum.type.equals(type)) {
				return frequencyEnum;
			}
		}
		return UNKNOW;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}
