package com.usky.rule.vo.action;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.usky.rule.enums.ActionTypeEnum;
import com.usky.rule.vo.visualization.SimpleVO;
import java.util.List;

public class DeviceControlAction implements RuleEngineAction {
    @JsonProperty("productId")
    private Integer productId;
    @JsonProperty("productCode")
    private String productCode;
    @JsonProperty("functions")
    private List<Functions> functions;
    @JsonProperty("devices")
    private List<SimpleVO> devices;

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

    public DeviceControlAction() {
    }

    public Integer getProductId() {
        return this.productId;
    }

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

    public List<Functions> getFunctions() {
        return this.functions;
    }

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

    @JsonProperty("productId")
    public void setProductId(final Integer productId) {
        this.productId = productId;
    }

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

    @JsonProperty("functions")
    public void setFunctions(final List<Functions> functions) {
        this.functions = functions;
    }

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

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof DeviceControlAction)) {
            return false;
        } else {
            DeviceControlAction other = (DeviceControlAction)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$productId = this.getProductId();
                Object other$productId = other.getProductId();
                if (this$productId == null) {
                    if (other$productId != null) {
                        return false;
                    }
                } else if (!this$productId.equals(other$productId)) {
                    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$functions = this.getFunctions();
                Object other$functions = other.getFunctions();
                if (this$functions == null) {
                    if (other$functions != null) {
                        return false;
                    }
                } else if (!this$functions.equals(other$functions)) {
                    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 DeviceControlAction;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $productId = this.getProductId();
        result = result * 59 + ($productId == null ? 43 : $productId.hashCode());
        Object $productCode = this.getProductCode();
        result = result * 59 + ($productCode == null ? 43 : $productCode.hashCode());
        Object $functions = this.getFunctions();
        result = result * 59 + ($functions == null ? 43 : $functions.hashCode());
        Object $devices = this.getDevices();
        result = result * 59 + ($devices == null ? 43 : $devices.hashCode());
        return result;
    }

    public String toString() {
        return "DeviceControlAction(productId=" + this.getProductId() + ", productCode=" + this.getProductCode() + ", functions=" + this.getFunctions() + ", devices=" + this.getDevices() + ")";
    }

    public static class Functions {
        @JsonProperty("identifier")
        private String identifier;
        @JsonProperty("identifierName")
        private String identifierName;
        @JsonProperty("value")
        private String value;
        @JsonProperty("delaySeconds")
        private Integer delaySeconds;

        public Functions() {
        }

        public String getIdentifier() {
            return this.identifier;
        }

        public String getIdentifierName() {
            return this.identifierName;
        }

        public String getValue() {
            return this.value;
        }

        public Integer getDelaySeconds() {
            return this.delaySeconds;
        }

        @JsonProperty("identifier")
        public void setIdentifier(final String identifier) {
            this.identifier = identifier;
        }

        @JsonProperty("identifierName")
        public void setIdentifierName(final String identifierName) {
            this.identifierName = identifierName;
        }

        @JsonProperty("value")
        public void setValue(final String value) {
            this.value = value;
        }

        @JsonProperty("delaySeconds")
        public void setDelaySeconds(final Integer delaySeconds) {
            this.delaySeconds = delaySeconds;
        }

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

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

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

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

                    return true;
                }
            }
        }

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

        public int hashCode() {
            int PRIME = 59;
            int result = 1;
            Object $delaySeconds = this.getDelaySeconds();
            result = result * 59 + ($delaySeconds == null ? 43 : $delaySeconds.hashCode());
            Object $identifier = this.getIdentifier();
            result = result * 59 + ($identifier == null ? 43 : $identifier.hashCode());
            Object $identifierName = this.getIdentifierName();
            result = result * 59 + ($identifierName == null ? 43 : $identifierName.hashCode());
            Object $value = this.getValue();
            result = result * 59 + ($value == null ? 43 : $value.hashCode());
            return result;
        }

        public String toString() {
            return "DeviceControlAction.Functions(identifier=" + this.getIdentifier() + ", identifierName=" + this.getIdentifierName() + ", value=" + this.getValue() + ", delaySeconds=" + this.getDelaySeconds() + ")";
        }
    }
}
