T
- public class SpelPropertyComparator<T> extends Object implements Comparator<T>
Comparator
implementation using SpelExpression
.Constructor and Description |
---|
SpelPropertyComparator(String path,
org.springframework.expression.spel.standard.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 org.springframework.expression.spel.standard.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, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public SpelPropertyComparator(String path, org.springframework.expression.spel.standard.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 org.springframework.expression.spel.standard.SpelExpression getExpression()
SpelExpression
protected String buildExpressionForPath()
public int compare(T arg1, T arg2)
compare
in interface Comparator<T>
public String getPath()
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.