T
- 被比较的Beanpublic class PropertyComparator<T> extends Object implements Comparator<T>, Serializable
Constructor and Description |
---|
PropertyComparator(String property)
构造
|
PropertyComparator(String property,
boolean isNullGreater)
构造
|
Modifier and Type | Method and Description |
---|---|
int |
compare(T o1,
T o2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public PropertyComparator(String property)
property
- 属性名public PropertyComparator(String property, boolean isNullGreater)
property
- 属性名isNullGreater
- null值是否排在后(从小到大排序)public int compare(T o1, T o2)
compare
in interface Comparator<T>
Copyright © 2021. All rights reserved.