public class StandardTypeComparator extends java.lang.Object implements TypeComparator
TypeComparator
implementation.
It supports comparison of Numbers and types implementing Comparable.Constructor and Description |
---|
StandardTypeComparator() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCompare(java.lang.Object left,
java.lang.Object right)
Return
true if the comparator can compare these two objects. |
private static int |
compare(byte x,
byte y) |
private static int |
compare(int x,
int y) |
private static int |
compare(long x,
long y) |
int |
compare(java.lang.Object left,
java.lang.Object right)
Compare two given objects.
|
private static int |
compare(short x,
short y) |
public boolean canCompare(@Nullable java.lang.Object left, @Nullable java.lang.Object right)
TypeComparator
true
if the comparator can compare these two objects.canCompare
in interface TypeComparator
left
- the first objectright
- the second objecttrue
if the comparator can compare these objectspublic int compare(@Nullable java.lang.Object left, @Nullable java.lang.Object right) throws SpelEvaluationException
TypeComparator
compare
in interface TypeComparator
left
- the first objectright
- the second objectSpelEvaluationException
private static int compare(long x, long y)
private static int compare(int x, int y)
private static int compare(short x, short y)
private static int compare(byte x, byte y)