类 org.test4j.hamcrest.matcher.property.difference.Difference
的使用

使用 Difference 的软件包
org.test4j.hamcrest.matcher.property.comparator   
org.test4j.hamcrest.matcher.property.difference   
org.test4j.hamcrest.matcher.property.reflection   
org.test4j.hamcrest.matcher.property.report   
 

org.test4j.hamcrest.matcher.property.comparatorDifference 的使用
 

返回 Differenceorg.test4j.hamcrest.matcher.property.comparator 中的方法
 Difference SimpleCasesComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given values.
 Difference ObjectComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given objects by iterating over the fields and comparing the corresponding values.
 Difference MapComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given maps by looping over the keys and comparing their values.
 Difference ListComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compared the given collections/arrays.
 Difference IgnoreOrderComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given collections/arrays but ignoring the actual order of the elements.
 Difference IgnoreNumberComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the two values by converting them to a double and comparing these double values.
 Difference IgnoreDefaultsComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Always returns null: both objects are equal.
 Difference IgnoreDatesComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given dates.
 Difference HibernateProxyComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given objects.
 Difference EqStringComparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
           
 Difference Comparator.compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compares the given objects and returns the difference (if any).
 

org.test4j.hamcrest.matcher.property.differenceDifference 的使用
 

org.test4j.hamcrest.matcher.property.differenceDifference 的子类
 class ClassDifference
           
 class CollectionDifference
          A class for holding the difference between two collections or arrays.
 class MapDifference
          A class for holding the difference between two collections or arrays.
 class ObjectDifference
          A class for holding the difference between two objects.
 class UnorderedCollectionDifference
          A class for holding the difference between all elements of two collections or arrays.
 

返回 Differenceorg.test4j.hamcrest.matcher.property.difference 中的方法
 Difference UnorderedCollectionDifference.getElementDifference(int leftIndex, int rightIndex)
          Gets the difference between the elements with the given indexes.
 

返回变量类型为 Difference 的类型的 org.test4j.hamcrest.matcher.property.difference 中的方法
 Map<Integer,Map<Integer,Difference>> UnorderedCollectionDifference.getElementDifferences()
          Gets all element differences per left index and right index.
 Map<Integer,Difference> CollectionDifference.getElementDifferences()
          Gets all element differences per index.
 Map<String,Difference> ObjectDifference.getFieldDifferences()
          Gets all differences per field name.
 Map<Object,Difference> MapDifference.getValueDifferences()
          Gets all element differences per key.
 

参数类型为 Differenceorg.test4j.hamcrest.matcher.property.difference 中的方法
 void CollectionDifference.addElementDifference(int index, Difference difference)
          Adds a difference for the element at the given index.
 void UnorderedCollectionDifference.addElementDifference(int leftIndex, int rightIndex, Difference difference)
          Adds a difference or a match for the elements at the given left and right index.
 void ObjectDifference.addFieldDifference(String fieldName, Difference difference)
          Adds a difference for the field with the given name.
 void MapDifference.addValueDifference(Object key, Difference difference)
          Adds a difference for the element at the given key.
 T DifferenceVisitor.visit(Difference difference, A argument)
          Visits a simple difference.
 

org.test4j.hamcrest.matcher.property.reflectionDifference 的使用
 

类型参数类型为 Differenceorg.test4j.hamcrest.matcher.property.reflection 中的字段
protected  Map<Object,Map<Object,Difference>> ReflectionComparator.allDifferencesCachedResults
           
protected  Map<Difference,Integer> MatchingScoreCalculator.cachedMatchingScores
          Cache for matching scores
protected  Map<Object,Map<Object,Difference>> ReflectionComparator.firstDifferenceCachedResults
          A cache of results, so that comparisons are only performed once and infinite loops because of cycles are avoided A different cache is used dependent on whether only the first difference is required or whether we need all differences, since the resulting Difference objects differ.
 

返回 Differenceorg.test4j.hamcrest.matcher.property.reflection 中的方法
 Difference ReflectionComparator.getDifference(Object expectedValue, Object actualValue)
          Checks whether there is a difference between the left and right objects.
 Difference ReflectionComparator.getDifference(Object expectedValue, Object actualValue, boolean onlyFirstDifference)
          Checks whether there are differences between the left and right objects.
static Difference InnerDifferenceFinder.getInnerDifference(String fieldName, Difference difference)
          Gets the difference at the given element/field/key (depending on the type of the given difference)
 Difference InnerDifferenceFinder.InnerDifferenceVisitor.visit(ClassDifference classDifference, String argument)
           
 Difference InnerDifferenceFinder.InnerDifferenceVisitor.visit(CollectionDifference collectionDifference, String indexString)
          Returns the difference at the field with the given index.
 Difference InnerDifferenceFinder.InnerDifferenceVisitor.visit(Difference difference, String key)
          Returns null, there are no inner differences for a simple difference.
 Difference InnerDifferenceFinder.InnerDifferenceVisitor.visit(MapDifference mapDifference, String keyString)
          Returns the difference at the given key.
 Difference InnerDifferenceFinder.InnerDifferenceVisitor.visit(ObjectDifference objectDifference, String fieldName)
          Returns the difference at the field with the given name.
 Difference InnerDifferenceFinder.InnerDifferenceVisitor.visit(UnorderedCollectionDifference unorderedCollectionDifference, String indexString)
          Returns the best matching difference at the field with the given index.
 

返回变量类型为 Difference 的类型的 org.test4j.hamcrest.matcher.property.reflection 中的方法
protected  Map<Object,Difference> ReflectionComparator.getCachedDifference(Object left, boolean onlyFirstDifference)
           
 

参数类型为 Differenceorg.test4j.hamcrest.matcher.property.reflection 中的方法
 int MatchingScoreCalculator.calculateMatchingScore(Difference difference)
          Gets the matching score for the given difference.
static Difference InnerDifferenceFinder.getInnerDifference(String fieldName, Difference difference)
          Gets the difference at the given element/field/key (depending on the type of the given difference)
protected  int MatchingScoreCalculator.getMatchingScore(Difference difference)
          Gets the matching score for a simple difference.
 Integer MatchingScoreCalculator.MatchingScoreVisitor.visit(Difference difference, Integer argument)
           
 Difference InnerDifferenceFinder.InnerDifferenceVisitor.visit(Difference difference, String key)
          Returns null, there are no inner differences for a simple difference.
 

类型变量类型为 Differenceorg.test4j.hamcrest.matcher.property.reflection 中的方法参数
protected  void ReflectionComparator.saveResultInCache(Object left, Map<Object,Difference> cachedResult, boolean onlyFirstDifference)
           
 

org.test4j.hamcrest.matcher.property.reportDifference 的使用
 

参数类型为 Differenceorg.test4j.hamcrest.matcher.property.report 中的方法
 String DifferenceReport.createReport(Difference difference)
          Creates a report.
 String DefaultDifferenceReport.createReport(Difference difference)
          Creates a report.
 String TreeDifferenceView.createView(Difference difference)
          Creates a string representation of the given difference tree.
 String SimpleDifferenceView.createView(Difference difference)
          Creates a string representation of the given difference tree.
 String DifferenceView.createView(Difference difference)
          Creates a string representation of the given difference tree.
 String DefaultDifferenceView.createView(Difference difference)
          Creates a string representation of the given difference tree.
protected  String TreeDifferenceView.formatDifference(Difference difference, String fieldName)
          Creates a string representation of a simple difference.
protected  String DefaultDifferenceView.formatDifference(Difference difference, String fieldName)
          Creates a string representation of a simple difference.
 String TreeDifferenceView.TreeDifferenceFormatterVisitor.visit(Difference difference, String fieldName)
           
 String DefaultDifferenceView.DifferenceFormatterVisitor.visit(Difference difference, String fieldName)
           
 



Copyright © 2013. All rights reserved.