ZQN
2024-06-17 b1ff19545212508d3f65741ab889f0b6df82a511
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.project.common.core.domain;
 
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.project.common.core.absclasses.BaseTreeNode;
import lombok.Data;
 
import java.util.Objects;
 
@Data
public class TreeNode extends BaseTreeNode<TreeNode>
{
    private static final long serialVersionUID = 1L;
 
    private String title;
 
    @JsonSerialize(using = ToStringSerializer.class)
    private Long key;
 
    @JsonSerialize(using = ToStringSerializer.class)
    private Long value;
 
    public TreeNode() {
    }
 
    public boolean equals(Object obj)
    {
        if (this == obj) {
            return true;
        } else if (obj == null) {
            return false;
        } else {
            TreeNode other = (TreeNode)obj;
            return Objects.equals(this.getId(), other.getId());
        }
    }
 
    public int hashCode()
    {
 
        return Objects.hash(new Object[]{this.id, this.parentId});
    }
 
 
 
    public String toString()
    {
 
        return "TreeNode(title=" + this.getTitle() + ", key=" + this.getKey() + ", value=" + this.getValue() + ")";
    }
}