package com.yuchen.saas.device.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.nest.springwrap.core.log.exception.ServiceException;

@Getter
@AllArgsConstructor
public enum NetCompareTypeEnum {
    EQ(1, "等于", "eq","eqComparePropertyService"),
    NEQ(2, "不等于", "not","notComparePropertyService"),
    GT(3, "大于", "gt","gtComparePropertyService"),
    GTE(4, "大于等于", "gte","gteComparePropertyService"),
    LT(5, "小于", "lt","ltComparePropertyService"),
    LTE(6, "小于等于", "lte","lteComparePropertyService"),

    ;

    private Integer value;
    private String desc;
    private String symbol;
    private String compareService;

    public static NetCompareTypeEnum convert(int intValue) {
        NetCompareTypeEnum[] allValues = NetCompareTypeEnum.values();
        for (NetCompareTypeEnum allValue : allValues) {
            if (allValue.value == intValue) {
                return allValue;
            }
        }
        throw new ServiceException("NetCompareTypeEnum 非法枚举参数值");
    }


}
