package com.usky.rule.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.usky.rule.util.JsonToStringDeserializer;
import java.util.List;

public class RuleEngineDetail {
    @JsonProperty("triggers")
    @JsonInclude(Include.NON_NULL)
    private List<CommonVO> triggers;
    @JsonProperty("constraints")
    @JsonInclude(Include.NON_NULL)
    private List<CommonVO> constraints;
    @JsonProperty("actions")
    @JsonInclude(Include.NON_NULL)
    private List<CommonVO> actions;

    public RuleEngineDetail() {
    }

    public List<CommonVO> getTriggers() {
        return this.triggers;
    }

    public List<CommonVO> getConstraints() {
        return this.constraints;
    }

    public List<CommonVO> getActions() {
        return this.actions;
    }

    @JsonProperty("triggers")
    public void setTriggers(final List<CommonVO> triggers) {
        this.triggers = triggers;
    }

    @JsonProperty("constraints")
    public void setConstraints(final List<CommonVO> constraints) {
        this.constraints = constraints;
    }

    @JsonProperty("actions")
    public void setActions(final List<CommonVO> actions) {
        this.actions = actions;
    }

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

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

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

                return true;
            }
        }
    }

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

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $triggers = this.getTriggers();
        result = result * 59 + ($triggers == null ? 43 : $triggers.hashCode());
        Object $constraints = this.getConstraints();
        result = result * 59 + ($constraints == null ? 43 : $constraints.hashCode());
        Object $actions = this.getActions();
        result = result * 59 + ($actions == null ? 43 : $actions.hashCode());
        return result;
    }

    public String toString() {
        return "RuleEngineDetail(triggers=" + this.getTriggers() + ", constraints=" + this.getConstraints() + ", actions=" + this.getActions() + ")";
    }

    public static class CommonVO {
        @JsonProperty("type")
        private String type;
        @JsonProperty("detail")
        @JsonDeserialize(
                using = JsonToStringDeserializer.class
        )
        private String detail;

        public CommonVO() {
        }

        public String getType() {
            return this.type;
        }

        public String getDetail() {
            return this.detail;
        }

        @JsonProperty("type")
        public void setType(final String type) {
            this.type = type;
        }

        @JsonProperty("detail")
        @JsonDeserialize(
                using = JsonToStringDeserializer.class
        )
        public void setDetail(final String detail) {
            this.detail = detail;
        }

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

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

                    return true;
                }
            }
        }

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

        public int hashCode() {
            int PRIME = 59;
            int result = 1;
            Object $type = this.getType();
            result = result * 59 + ($type == null ? 43 : $type.hashCode());
            Object $detail = this.getDetail();
            result = result * 59 + ($detail == null ? 43 : $detail.hashCode());
            return result;
        }

        public String toString() {
            return "RuleEngineDetail.CommonVO(type=" + this.getType() + ", detail=" + this.getDetail() + ")";
        }
    }
}
