Package org.aoju.bus.core.compare
Class FuncCompare<T>
java.lang.Object
org.aoju.bus.core.compare.NullCompare<T>
org.aoju.bus.core.compare.FuncCompare<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.aoju.bus.core.compare.NullCompare
comparator, nullGreater -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.aoju.bus.core.compare.NullCompare
compare, reversed, 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, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
FuncCompare
构造- Parameters:
nullGreater- 是否null在后func- 比较项获取函数
-
-
Method Details
-
doCompare
Description copied from class:NullCompare不检查null的比较方法 用户可自行重写此方法自定义比较方式- Overrides:
doComparein classNullCompare<T>- Parameters:
a- A值b- B值- Returns:
- 比较结果,-1:a小于b,0:相等,1:a大于b
-