org.test4j.hamcrest.matcher.property.comparator
类 EqStringComparator

java.lang.Object
  继承者 org.test4j.hamcrest.matcher.property.comparator.EqStringComparator
所有已实现的接口:
Comparator

public class EqStringComparator
extends Object
implements Comparator


构造方法摘要
EqStringComparator()
           
 
方法摘要
 boolean canCompare(Object left, Object right)
          Checks whether this comparator can compare the given objects.
 Difference compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given objects and returns the difference (if any).
static String toString(Object obj, Object format)
          将obj对象转换为String对象
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

EqStringComparator

public EqStringComparator()
方法详细信息

canCompare

public boolean canCompare(Object left,
                          Object right)
从接口 Comparator 复制的描述
Checks whether this comparator can compare the given objects.

This method should always be called before calling the compare method. If false is returned compare should not be invoked.

指定者:
接口 Comparator 中的 canCompare
参数:
left - The left object
right - The right object
返回:
True if compare can be called, false otherwise

compare

public Difference compare(Object left,
                          Object right,
                          boolean onlyFirstDifference,
                          ReflectionComparator reflectionComparator)
从接口 Comparator 复制的描述
Compares the given objects and returns the difference (if any).

The reflection comparator is passed as an argument and can be used to perform inner comparisons. E.g. during the comparison of an object the given comparator can be used to compare the instance fields of the object.

指定者:
接口 Comparator 中的 compare
参数:
left - The left object
right - The right object
onlyFirstDifference - True if only the first difference should be returned
reflectionComparator - The root comparator for inner comparisons, not null
返回:
The difference, null if a match is found

toString

public static String toString(Object obj,
                              Object format)
将obj对象转换为String对象

参数:
obj -
format -
返回:


Copyright © 2013. All rights reserved.