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