T
- 被比较的对象public class FuncComparator<T> extends NullComparator<T>
comparator, nullGreater
Constructor and Description |
---|
FuncComparator(boolean nullGreater,
boolean compareSelf,
Function<T,Comparable<?>> func)
构造
|
compare, doCompare, thenComparing
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public FuncComparator(boolean nullGreater, boolean compareSelf, Function<T,Comparable<?>> func)
nullGreater
- 是否null
在后compareSelf
- 在字段值相同情况下,是否比较对象本身。
如果此项为false
,字段值比较后为0会导致对象被认为相同,可能导致被去重。func
- 比较项获取函数Copyright © 2025. All rights reserved.