package cn.com.ctop.alarm.modules.enums;

/**
 * 条件枚举
 *
 * @param
 * @author ZHAOXA
 * @return
 * @throws
 */
public enum ConditEnum {
    EQUAL("equal", "等于"),
    NOT_EQUAL("not_equal", "不等于"),
    GREATER("greater", "大于"),
    LESS("less", "小于"),
    GREATER_EQUAL("greater_equal", "大于等于"),
    LESS_EQUAL("less_equal", "小于等于"),
    NO_CONTAIN("no_contain", "不包含"),
    CONTAIN("contain", "包含");

    private String name;
    private String code;

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

    public static ConditEnum getEnumByCode(String code) {
        for (ConditEnum em : ConditEnum.values()) {
            if (em.code.equals(code)) {
                return em;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }
}
