org.test4j.hamcrest.matcher.property.difference
接口 DifferenceVisitor<T,A>

所有已知实现类:
DefaultDifferenceView.DifferenceFormatterVisitor, InnerDifferenceFinder.InnerDifferenceVisitor, MatchingScoreCalculator.MatchingScoreVisitor, TreeDifferenceView.TreeDifferenceFormatterVisitor

public interface DifferenceVisitor<T,A>

A visitor for visiting all types of differences.

All difference classes should implement a double-dispatch method as follows:

 public <T, A> T accept(DifferenceVisitor<T, A> visitor, A argument) {
      return visitor.visit(this, argument);
 }
 

The visitor logic can the be invoked as follows:

 difference.accept(new MyVisitor(), anOptionalArgument);
 

T determines the result type, A determines the type of the optional argument


方法摘要
 T visit(ClassDifference classDifference, A argument)
          Visits a class difference.
 T visit(CollectionDifference collectionDifference, A argument)
          Visits a collection difference.
 T visit(Difference difference, A argument)
          Visits a simple difference.
 T visit(MapDifference mapDifference, A argument)
          Visits a map difference.
 T visit(ObjectDifference objectDifference, A argument)
          Visits an object difference.
 T visit(UnorderedCollectionDifference unorderedCollectionDifference, A argument)
          Visits an unordered collection difference.
 

方法详细信息

visit

T visit(Difference difference,
        A argument)
Visits a simple difference.

参数:
difference - The difference
argument - An optional argument, null if NA
返回:
The result

visit

T visit(ObjectDifference objectDifference,
        A argument)
Visits an object difference.

参数:
objectDifference - The difference
argument - An optional argument, null if NA
返回:
The result

visit

T visit(ClassDifference classDifference,
        A argument)
Visits a class difference.

参数:
classDifference - The difference
argument - An optional argument, null if NA
返回:
The result

visit

T visit(MapDifference mapDifference,
        A argument)
Visits a map difference.

参数:
mapDifference - The difference
argument - An optional argument, null if NA
返回:
The result

visit

T visit(CollectionDifference collectionDifference,
        A argument)
Visits a collection difference.

参数:
collectionDifference - The difference
argument - An optional argument, null if NA
返回:
The result

visit

T visit(UnorderedCollectionDifference unorderedCollectionDifference,
        A argument)
Visits an unordered collection difference.

参数:
unorderedCollectionDifference - The difference
argument - An optional argument, null if NA
返回:
The result


Copyright © 2013. All rights reserved.