public class SortUtil extends Object
| 构造器和说明 |
|---|
SortUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
private static Integer |
compare(Method method,
Object one,
Object two,
Sort.Direction direction)
do method
|
private static Integer |
compare(Object one,
Object two,
Sort.Direction direction)
compare two object which could be Integer, Double,
Long, Short, Float, Date
|
private static Integer |
compare(Object paramOne,
Object paramTwo,
String fieldName,
Sort.Direction direction)
给doSort方法调用的比较方法
|
static <T> void |
doSort(Sort sort,
List<T> paramList)
给外部调用的排序的方法
|
public static <T> void doSort(Sort sort, List<T> paramList) throws SortException
T - sort - paramList - SortExceptionprivate static Integer compare(Object paramOne, Object paramTwo, String fieldName, Sort.Direction direction) throws Exception
paramOne - entityparamTwo - entityfieldName - field name which is used to comparedirection - compare directionExceptionprivate static Integer compare(Object one, Object two, Sort.Direction direction) throws Exception
one - two - direction - ExceptionCopyright © 2019. All rights reserved.