类 ConvertingComparator<S,T>
java.lang.Object
cn.taketoday.core.conversion.ConvertingComparator<S,T>
- 类型参数:
S- the source typeT- the target type
- 所有已实现的接口:
Comparator<S>
A
Comparator that converts values before they are compared.
The specified Converter will be used to convert each value
before it is passed to the underlying Comparator.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb
-
构造器概要
构造器构造器说明ConvertingComparator(Converter<S, T> converter) Create a newConvertingComparatorinstance.ConvertingComparator(Comparator<T> comparator, ConversionService conversionService, Class<? extends T> targetType) Create a newConvertingComparatorinstance.ConvertingComparator(Comparator<T> comparator, Converter<S, T> converter) Create a newConvertingComparatorinstance. -
方法概要
修饰符和类型方法说明intstatic <K,V> ConvertingComparator<Map.Entry<K, V>, K> mapEntryKeys(Comparator<K> comparator) static <K,V> ConvertingComparator<Map.Entry<K, V>, V> mapEntryValues(Comparator<V> comparator) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
构造器详细资料
-
ConvertingComparator
Create a newConvertingComparatorinstance.- 参数:
converter- the converter
-
ConvertingComparator
Create a newConvertingComparatorinstance.- 参数:
comparator- the underlying comparator used to compare the converted valuesconverter- the converter
-
ConvertingComparator
public ConvertingComparator(Comparator<T> comparator, ConversionService conversionService, Class<? extends T> targetType) Create a newConvertingComparatorinstance.- 参数:
comparator- the underlying comparatorconversionService- the conversion servicetargetType- the target type
-
-
方法详细资料
-
compare
- 指定者:
compare在接口中Comparator<S>
-
mapEntryKeys
- 参数:
comparator- the underlying comparator used to compare keys- 返回:
- a new
ConvertingComparatorinstance
-
mapEntryValues
public static <K,V> ConvertingComparator<Map.Entry<K,V>, mapEntryValuesV> (Comparator<V> comparator) - 参数:
comparator- the underlying comparator used to compare values- 返回:
- a new
ConvertingComparatorinstance
-