Class StandardTypeComparator
java.lang.Object
org.springframework.expression.spel.support.StandardTypeComparator
- All Implemented Interfaces:
TypeComparator
A basic
TypeComparator implementation: supports comparison of
Number types as well as types implementing Comparable.- Since:
- 3.0
- Author:
- Andy Clement, Juergen Hoeller, Giovanni Dall'Oglio Risso
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
StandardTypeComparator
public StandardTypeComparator()
-
-
Method Details
-
canCompare
Description copied from interface:TypeComparatorReturntrueif the comparator can compare these two objects.- Specified by:
canComparein interfaceTypeComparator- Parameters:
left- the first objectright- the second object- Returns:
trueif the comparator can compare these objects
-
compare
Description copied from interface:TypeComparatorCompare two given objects.- Specified by:
comparein interfaceTypeComparator- Parameters:
left- the first objectright- the second object- Returns:
- 0 if they are equal, a negative integer if the first is smaller than the second, or a positive integer if the first is larger than the second
- Throws:
SpelEvaluationException- See Also:
-