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


构造方法摘要
SimpleCasesComparator()
           
 
方法摘要
 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.
 Difference compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given values.
 
从类 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 object
right - 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 value
right - The right value
onlyFirstDifference - True if only the first difference should be returned
reflectionComparator - The root comparator for inner comparisons, not null
返回:
A Difference if both values are different, null otherwise


Copyright © 2013. All rights reserved.