ClassifyDialogBean.java
1.76 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.wd.foundation.bean.custom;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import androidx.annotation.NonNull;
/**
* 二级分类的数据结构
*
* @author libo
* @version [V1.0.0, 2022/10/20]
* @since V1.0.0
*/
public class ClassifyDialogBean implements Cloneable{
public String id;
public String name;
public boolean isCheck;
public boolean mAdapterDateIsEmpty;
public boolean canMove = true;
public List<Child> childList = new ArrayList<>();
public static class Child implements Cloneable{
public String parentId;
public String id;
public String name;
public boolean isCheck;
@NonNull
public Child clone() {
try {
return (Child) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return this;
}
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClassifyDialogBean that = (ClassifyDialogBean) o;
return Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@NonNull
@Override
public ClassifyDialogBean clone() {
try {
ClassifyDialogBean bean= (ClassifyDialogBean) super.clone();
if (childList!=null){
bean.childList = childList;//.stream().map(Child::clone).collect(Collectors.toList());
}
return bean;
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return this;
}
}