forked from plusone/plusone-commons
使用 AssertTools 替代 Preconditions
This commit is contained in:
@@ -27,8 +27,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
/**
|
||||
* TreeBuilder
|
||||
*
|
||||
@@ -63,7 +61,7 @@ public class TreeBuilder<T, TSubTree extends T, TIdentity> {
|
||||
* @param nodes 平铺的节点列表
|
||||
*/
|
||||
public List<T> buildTree(Collection<T> nodes) {
|
||||
Preconditions.checkNotNull(nodes);
|
||||
AssertTools.checkNotNull(nodes);
|
||||
return buildTreeInternal(nodes, this.defaultComparator);
|
||||
}
|
||||
|
||||
@@ -80,7 +78,7 @@ public class TreeBuilder<T, TSubTree extends T, TIdentity> {
|
||||
* <b>仅影响调用 addChild 的顺序,如果操作对象本身对应的控制了子节点的顺序,无法影响其相关逻辑。</b>
|
||||
*/
|
||||
public List<T> buildTree(Collection<T> nodes, @Nullable Comparator<? super T> comparator) {
|
||||
Preconditions.checkNotNull(nodes);
|
||||
AssertTools.checkNotNull(nodes);
|
||||
final Comparator<? super T> c = (comparator != null) ? comparator : this.defaultComparator;
|
||||
return buildTreeInternal(nodes, c);
|
||||
}
|
||||
|
Reference in New Issue
Block a user