org.test4j.hamcrest.matcher.property.comparator
类 SimpleCasesComparator
java.lang.Object
org.test4j.hamcrest.matcher.property.comparator.SimpleCasesComparator
- 所有已实现的接口:
- Comparator
public class SimpleCasesComparator
- extends Object
- implements Comparator
Comparator for simple cases. Following cases are handled: left and right are
the same instance, left or right have a null value, left or right are
enumerations, left or right are java.lang classes and left or right are of
type Character or Number
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleCasesComparator
public SimpleCasesComparator()
canCompare
public boolean canCompare(Object left,
Object right)
- Returns true if both object are the same instance, have a null value, are
an Enum/Number/Character or are a java.lang type.
- 指定者:
- 接口
Comparator 中的 canCompare
- 参数:
left - The left objectright - The right object
- 返回:
- True for simple cases
compare
public Difference compare(Object left,
Object right,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
- Compares the given values.
- 指定者:
- 接口
Comparator 中的 compare
- 参数:
left - The left valueright - The right valueonlyFirstDifference - True if only the first difference should be returnedreflectionComparator - The root comparator for inner comparisons, not null
- 返回:
- A Difference if both values are different, null otherwise
Copyright © 2013. All rights reserved.