T - public class SpelPropertyComparator<T> extends Object implements Comparator<T>
Comparator implementation using SpelExpression.| Constructor and Description |
|---|
SpelPropertyComparator(String path,
SpelExpressionParser parser)
Create new
SpelPropertyComparator for the given property path an SpelExpressionParser. |
| Modifier and Type | Method and Description |
|---|---|
SpelPropertyComparator<T> |
asc()
Sort ascending.
|
protected String |
buildExpressionForPath()
Create the expression raw value.
|
int |
compare(T arg1,
T arg2) |
SpelPropertyComparator<T> |
desc()
Sort descending.
|
protected SpelExpression |
getExpression()
Parse values to
SpelExpression |
String |
getPath()
Get dot path to property.
|
SpelPropertyComparator<T> |
nullsFirst()
Sort null values first.
|
SpelPropertyComparator<T> |
nullsLast()
Sort null values last.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic SpelPropertyComparator(String path, SpelExpressionParser parser)
SpelPropertyComparator for the given property path an SpelExpressionParser.path - must not be null or empty.parser - must not be null.public SpelPropertyComparator<T> asc()
public SpelPropertyComparator<T> desc()
public SpelPropertyComparator<T> nullsFirst()
public SpelPropertyComparator<T> nullsLast()
protected SpelExpression getExpression()
SpelExpressionprotected String buildExpressionForPath()
public int compare(T arg1, T arg2)
compare in interface Comparator<T>public String getPath()
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.