org.test4j.hamcrest.matcher.property.comparator
类 IgnoreNumberComparator
java.lang.Object
org.test4j.hamcrest.matcher.property.comparator.IgnoreNumberComparator
- 所有已实现的接口:
- Comparator
public class IgnoreNumberComparator
- extends Object
- implements Comparator
A comparator that compares primitive types by value and not by type.
You can for example compare a double with an integer value.
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IgnoreNumberComparator
public IgnoreNumberComparator()
canCompare
public boolean canCompare(Object left,
Object right)
- Returns true if both objects are not null and instances of Number or Character.
- 指定者:
- 接口
Comparator 中的 canCompare
- 参数:
left - The left objectright - The right object
- 返回:
- True for Numbers and Charaters
compare
public Difference compare(Object left,
Object right,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
- Compares the two values by converting them to a double and comparing these double values.
- 指定者:
- 接口
Comparator 中的 compare
- 参数:
left - The left Number or Character, not nullright - The right Number or Character, not nullonlyFirstDifference - True if only the first difference should be returnedreflectionComparator - The root comparator for inner comparisons, not null
- 返回:
- A difference if the values are different, null otherwise
Copyright © 2013. All rights reserved.