package com.qianhe.zqbf.domain;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

public class TreeSelectT implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 节点ID
     */
    private String value;

    /**
     * 节点名称
     */
    private String label;

    /**
     * 子节点
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeSelectT> children;

    public TreeSelectT() {}

    public TreeSelectT(DictTreeselectVO dictTreeselectVO) {
        this.value = dictTreeselectVO.getValue();
        this.label = dictTreeselectVO.getLabel();
        this.children = dictTreeselectVO.getChildren().stream().map(TreeSelectT::new).collect(Collectors.toList());
    }

    public String getValue() {
        return value;
    }

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

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

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

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