T - public static class Comparators.ComparatorHelper<T> extends Object implements Comparator<T>
| 限定符和类型 | 方法和说明 |
|---|---|
Comparators.ComparatorHelper<T> |
ascBy(Comparators.Getter<T> getter)
参与对比的属性
|
int |
compare(T o1,
T o2) |
Comparators.ComparatorHelper<T> |
descBy(Comparators.Getter<T> getter)
参与对比的属性
|
Comparators.ComparatorHelper<T> |
nullLast()
为null排在后面
|
Comparators.ComparatorHelper<T> |
orderBy(Comparators.Getter<T> getter)
参与对比的属性
|
Comparators.ComparatorHelper<T> |
orderBy(Comparators.Getter<T> getter,
boolean asc)
参与对比的属性
|
void |
sort(List<T> list)
对指定的列表进行排序
|
public Comparators.ComparatorHelper<T> orderBy(Comparators.Getter<T> getter)
getter - public Comparators.ComparatorHelper<T> orderBy(Comparators.Getter<T> getter, boolean asc)
getter - asc - 为true使用升序,为false使用降序public Comparators.ComparatorHelper<T> ascBy(Comparators.Getter<T> getter)
getter - public Comparators.ComparatorHelper<T> descBy(Comparators.Getter<T> getter)
getter - public Comparators.ComparatorHelper<T> nullLast()
public int compare(T o1, T o2)
compare 在接口中 Comparator<T>Copyright © 2020. All rights reserved.