package com.usky.rule.vo.action;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.usky.rule.enums.ActionTypeEnum;
import com.usky.rule.vo.visualization.AlarmSimpleVO;

import java.util.List;

public class AlarmEventAction implements RuleEngineAction {
    @JsonProperty("alarmGrade")
    private Integer alarmGrade;
    @JsonProperty("productCode")
    private String productCode;
    @JsonProperty("alarmType")
    private String alarmType;
    @JsonProperty("alarmAttribute")
    private String alarmAttribute;
    @JsonProperty("devices")
    private List<AlarmSimpleVO> devices;

    public String getType() {
        return ActionTypeEnum.ALARM_EVENT.getType();
    }

    public AlarmEventAction() {
    }

    public Integer getAlarmGrade() {
        return this.alarmGrade;
    }

    public String getProductCode() {
        return this.productCode;
    }

    public String getAlarmType() {
        return this.alarmType;
    }

    public String getAlarmAttribute() {
        return this.alarmAttribute;
    }

    public List<AlarmSimpleVO> getDevices() {
        return this.devices;
    }

    @JsonProperty("alarmGrade")
    public void setAlarmGrade(final Integer alarmGrade) {
        this.alarmGrade = alarmGrade;
    }

    @JsonProperty("productCode")
    public void setProductCode(final String productCode) {
        this.productCode = productCode;
    }

    @JsonProperty("alarmType")
    public void setAlarmType(final String alarmType) {
        this.alarmType = alarmType;
    }

    @JsonProperty("alarmAttribute")
    public void setAlarmAttribute(final String alarmAttribute) {
        this.alarmAttribute = alarmAttribute;
    }

    @JsonProperty("devices")
    public void setDevices(final List<AlarmSimpleVO> devices) {
        this.devices = devices;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof AlarmEventAction)) {
            return false;
        } else {
            AlarmEventAction other = (AlarmEventAction)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$alarmGrade = this.getAlarmGrade();
                Object other$alarmGrade = other.getAlarmGrade();
                if (this$alarmGrade == null) {
                    if (other$alarmGrade != null) {
                        return false;
                    }
                } else if (!this$alarmGrade.equals(other$alarmGrade)) {
                    return false;
                }

                Object this$productCode = this.getProductCode();
                Object other$productCode = other.getProductCode();
                if (this$productCode == null) {
                    if (other$productCode != null) {
                        return false;
                    }
                } else if (!this$productCode.equals(other$productCode)) {
                    return false;
                }

                Object this$alarmType = this.getAlarmType();
                Object other$alarmType = other.getAlarmType();
                if (this$alarmType == null) {
                    if (other$alarmType != null) {
                        return false;
                    }
                } else if (!this$alarmType.equals(other$alarmType)) {
                    return false;
                }

                Object this$alarmAttribute = this.getAlarmAttribute();
                Object other$alarmAttribute = other.getAlarmAttribute();
                if (this$alarmAttribute == null) {
                    if (other$alarmAttribute != null) {
                        return false;
                    }
                } else if (!this$alarmAttribute.equals(other$alarmAttribute)) {
                    return false;
                }

                Object this$devices = this.getDevices();
                Object other$devices = other.getDevices();
                if (this$devices == null) {
                    if (other$devices != null) {
                        return false;
                    }
                } else if (!this$devices.equals(other$devices)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof AlarmEventAction;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $alarmGrade = this.getAlarmGrade();
        result = result * 59 + ($alarmGrade == null ? 43 : $alarmGrade.hashCode());
        Object $productCode = this.getProductCode();
        result = result * 59 + ($productCode == null ? 43 : $productCode.hashCode());
        Object $alarmType = this.getAlarmType();
        result = result * 59 + ($alarmType == null ? 43 : $alarmType.hashCode());
        Object $alarmAttribute = this.getAlarmAttribute();
        result = result * 59 + ($alarmAttribute == null ? 43 : $alarmAttribute.hashCode());
        Object $devices = this.getDevices();
        result = result * 59 + ($devices == null ? 43 : $devices.hashCode());
        return result;
    }

    public String toString() {
        return "AlarmEventAction(alarmGrade=" + this.getAlarmGrade() + ", productCode=" + this.getProductCode()
            + ", alarmType="
            + this.getAlarmType() + ", alarmAttribute=" + this.getAlarmAttribute() + ", devices=" + this.getDevices() + ")";
    }
}
