类 StandardTypeComparator
- java.lang.Object
- org.springframework.expression.spel.support.StandardTypeComparator
- 所有已实现的接口:
TypeComparator
public class StandardTypeComparator extends Object implements TypeComparator
A basicTypeComparator
implementation: supports comparison ofNumber
types as well as types implementingComparable
.- 从以下版本开始:
- 3.0
- 作者:
- Andy Clement, Juergen Hoeller, Giovanni Dall'Oglio Risso
构造器概要
构造器 构造器 说明 StandardTypeComparator()
构造器详细资料
StandardTypeComparator
public StandardTypeComparator()
方法详细资料
canCompare
public boolean canCompare(@Nullable Object left, @Nullable Object right)
从接口复制的说明:TypeComparator
Returntrue
if the comparator can compare these two objects.- 指定者:
canCompare
在接口中TypeComparator
- 参数:
left
- the first objectright
- the second object- 返回:
true
if the comparator can compare these objects
compare
public int compare(@Nullable Object left, @Nullable Object right) throws SpelEvaluationException
从接口复制的说明:TypeComparator
Compare two given objects.- 指定者:
compare
在接口中TypeComparator
- 参数:
left
- the first objectright
- the second object- 返回:
- 0 if they are equal, <0 if the first is smaller than the second, or>0 if the first is larger than the second
- 抛出:
SpelEvaluationException