package org.springblade.manager.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.models.auth.In;
import org.springblade.core.tool.node.BaseNode;
import org.springblade.core.tool.node.TreeNode;


/**
 * 重写了TreeNode实体，增加了type、primaryKeyId字段用于返回给前端
 */
public class TreeNodeVO extends BaseNode<TreeNode> {
    private static final long serialVersionUID = 1L;
    private String title;
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    private Long key;
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    private Long value;

    private Integer type;

    private String primaryKeyId;

    private Integer wbsType;

    private Integer deptCategory;

    private Integer isExistForm;

    public TreeNodeVO() {
    }

    public Integer getIsExistForm() {
        return isExistForm;
    }

    public void setIsExistForm(Integer isExistForm) {
        this.isExistForm = isExistForm;
    }

    public Integer getDeptCategory() {
        return deptCategory;
    }

    public void setDeptCategory(Integer deptCategory) {
        this.deptCategory = deptCategory;
    }

    public Integer getWbsType() {
        return wbsType;
    }

    public void setWbsType(Integer wbsType) {
        this.wbsType = wbsType;
    }

    public String getPrimaryKeyId() {
        return primaryKeyId;
    }

    public void setPrimaryKeyId(String primaryKeyId) {
        this.primaryKeyId = primaryKeyId;
    }

    public Integer getType() {
        return type;
    }

    public String getTitle() {
        return this.title;
    }

    public Long getKey() {
        return this.key;
    }

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

    public void setType(Integer type) {
        this.type = type;
    }

    public void setTitle(final String title) {
        this.title = title;
    }

    public void setKey(final Long key) {
        this.key = key;
    }

    public void setValue(final Long value) {
        this.value = value;
    }

    public String toString() {
        return "TreeNode(deptCategory=" + this.getDeptCategory() + ",isExistForm" + this.getIsExistForm() + ",wbsType=" + this.getWbsType() + ", primaryKeyId=" + this.getPrimaryKeyId() + ", type=" + this.getType() + ", title=" + this.getTitle() + ", key=" + this.getKey() + ", value=" + this.getValue() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof TreeNode)) {
            return false;
        } else {
            TreeNodeVO other = (TreeNodeVO) o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label47:
                {
                    Object this$key = this.getKey();
                    Object other$key = other.getKey();
                    if (this$key == null) {
                        if (other$key == null) {
                            break label47;
                        }
                    } else if (this$key.equals(other$key)) {
                        break label47;
                    }

                    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;
                }

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

                return true;
            }
        }
    }

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

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $key = this.getKey();
        result = result * 59 + ($key == null ? 43 : $key.hashCode());
        Object $value = this.getValue();
        result = result * 59 + ($value == null ? 43 : $value.hashCode());
        Object $title = this.getTitle();
        result = result * 59 + ($title == null ? 43 : $title.hashCode());
        return result;
    }
}
