孔祥富
2021-03-01 458cb4e562d6d9dbf6ff14fa86a11f06762982c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cc.mrbird.febs.common.core.entity;
 
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * @author MrBird
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Tree<T> {
 
    private String id;
 
    private String label;
 
    private List<Tree<T>> children;
 
    private String parentId;
 
    private boolean hasParent = false;
 
    private boolean hasChildren = false;
 
    public void initChildren() {
        this.children = new ArrayList<>();
    }
 
}