mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add equals
This commit is contained in:
parent
2aae44e569
commit
f7cf53455f
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.6.0 (2021-03-07)
|
||||
# 5.6.0 (2021-03-10)
|
||||
|
||||
### 新特性
|
||||
* 【poi 】 重要:不再兼容POI-3.x,增加兼容POI-5.x(issue#I35J6B@Gitee)
|
||||
@ -13,6 +13,7 @@
|
||||
* 【core 】 增加FuncKeyMap(issue#1402@Github)
|
||||
* 【core 】 增加StrMatcher(issue#1379@Github)
|
||||
* 【core 】 NumberUtil增加factorial针对BigInterger方法(issue#1379@Github)
|
||||
* 【core 】 TreeNode增加equals方法(issue#1467@Github)
|
||||
|
||||
### Bug修复
|
||||
* 【socket 】 修复Client创建失败资源未释放问题。
|
||||
|
@ -2,6 +2,7 @@ package cn.hutool.core.lang.tree;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 树节点 每个属性都可以在{@link TreeNodeConfig}中被重命名<br>
|
||||
@ -129,4 +130,21 @@ public class TreeNode<T> implements Node<T> {
|
||||
this.extra = extra;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TreeNode<?> treeNode = (TreeNode<?>) o;
|
||||
return Objects.equals(id, treeNode.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user