public class UnorderedCollectionDifference extends Difference
| Constructor and Description |
|---|
UnorderedCollectionDifference(String message,
Object leftValue,
Object rightValue,
List<?> leftList,
List<?> rightList)
Creates a difference.
|
| Modifier and Type | Method and Description |
|---|---|
<T,A> T |
accept(DifferenceVisitor<T,A> visitor,
A argument)
Double dispatch method.
|
void |
addElementDifference(int leftIndex,
int rightIndex,
Difference difference)
Adds a difference or a match for the elements at the given left and right index.
|
Map<Integer,Integer> |
getBestMatchingIndexes()
Gets the indexes of the best matching element differences.
|
int |
getBestMatchingScore()
Gets the matching score of the best matching indexes.
|
Difference |
getElementDifference(int leftIndex,
int rightIndex)
Gets the difference between the elements with the given indexes.
|
Map<Integer,Map<Integer,Difference>> |
getElementDifferences()
Gets all element differences per left index and right index.
|
List<?> |
getLeftList() |
List<?> |
getRightList() |
void |
setBestMatchingIndexes(int leftIndex,
int rightIndex)
Sets the given left and right index as best matching elements.
|
void |
setBestMatchingScore(int bestMatchingScore)
Gets the matching score of the best matching indexes.
|
getLeftValue, getMessage, getRightValuepublic UnorderedCollectionDifference(String message, Object leftValue, Object rightValue, List<?> leftList, List<?> rightList)
message - a message describing the differenceleftValue - the left instancerightValue - the right instanceleftList - The left instance as a listrightList - The right instance as a listpublic void addElementDifference(int leftIndex,
int rightIndex,
Difference difference)
leftIndex - The index of the left elementrightIndex - The index of the right elementdifference - The difference, null for a matchpublic Difference getElementDifference(int leftIndex, int rightIndex)
leftIndex - The left element indexrightIndex - The right element indexpublic Map<Integer,Map<Integer,Difference>> getElementDifferences()
public void setBestMatchingIndexes(int leftIndex,
int rightIndex)
leftIndex - The left indexrightIndex - The right indexpublic Map<Integer,Integer> getBestMatchingIndexes()
public int getBestMatchingScore()
public void setBestMatchingScore(int bestMatchingScore)
bestMatchingScore - The scorepublic List<?> getLeftList()
public List<?> getRightList()
public <T,A> T accept(DifferenceVisitor<T,A> visitor, A argument)
accept in class Differencevisitor - The visitor, not nullargument - An optional argument for the visitor, null if not applicableCopyright © 2016. All Rights Reserved.