package com.sifang.modules.setting.req;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.apache.poi.ss.formula.functions.T;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class TreeNode {
    private String title;
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    private Long key;
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    private Long value;
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    protected Long id;

    @JsonSerialize(
            using = ToStringSerializer.class
    )
    protected Long parentId;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    protected List<T> children = new ArrayList();
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Boolean hasChildren;


    public int hashCode() {
        return Objects.hash(new Object[]{this.id, this.parentId});
    }

    public TreeNode() {
    }

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

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

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

    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 Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public List<T> getChildren() {
        return children;
    }

    public void setChildren(List<T> children) {
        this.children = children;
    }

    public Boolean getHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(Boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    public String toString() {
        String var10000 = this.getTitle();
        return "TreeNode(title=" + var10000 + ", key=" + this.getKey() + ", value=" + this.getValue() + ")";
    }
}
