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 NetSceneTriggerMethodEnum {
    PROPERTIES(1, "属性触发"),
    EVENT(2, "事件触发"),
    DEVICE_CONNECT(3, "上下线触发"),

    ;

    private Integer value;
    private String desc;

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


}
