Package org.miaixz.bus.core.compare
Class FunctionCompare<T>
java.lang.Object
org.miaixz.bus.core.compare.NullCompare<T>
org.miaixz.bus.core.compare.FunctionCompare<T>
- Type Parameters:
T- 被比较的对象
- All Implemented Interfaces:
Serializable,Comparator<T>
- Direct Known Subclasses:
FieldCompare,PropertyCompare
指定函数排序器
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Field Summary
Fields inherited from class org.miaixz.bus.core.compare.NullCompare
comparator, nullGreater -
Constructor Summary
ConstructorsConstructorDescriptionFunctionCompare(boolean nullGreater, boolean compareSelf, Function<T, Comparable<?>> func) 构造 -
Method Summary
Methods inherited from class org.miaixz.bus.core.compare.NullCompare
compare, doCompare, thenComparingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
FunctionCompare
构造- Parameters:
nullGreater- 是否null在后compareSelf- 在字段值相同情况下,是否比较对象本身。 如果此项为false,字段值比较后为0会导致对象被认为相同,可能导致被去重。func- 比较项获取函数
-