public class CollectionDifference extends Difference
| Constructor and Description |
|---|
CollectionDifference(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 index,
Difference difference)
Adds a difference for the element at the given index.
|
void |
addLeftMissingIndex(int index)
Adds an index of a left element that is missing in the right collection.
|
void |
addRightMissingIndex(int index)
Adds an index of a right element that is missing in the left collection.
|
Map<Integer,Difference> |
getElementDifferences()
Gets all element differences per index.
|
List<?> |
getLeftList() |
List<Integer> |
getLeftMissingIndexes()
Gets the indexes of the left elements that were missing in the right collection.
|
List<?> |
getRightList() |
List<Integer> |
getRightMissingIndexes()
Gets the indexes of the right elements that were missing in the left collection.
|
getLeftValue, getMessage, getRightValuepublic CollectionDifference(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 index,
Difference difference)
index - The element indexdifference - The difference, not nullpublic Map<Integer,Difference> getElementDifferences()
public void addLeftMissingIndex(int index)
index - The left element indexpublic List<Integer> getLeftMissingIndexes()
public void addRightMissingIndex(int index)
index - The right element indexpublic List<Integer> getRightMissingIndexes()
public 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.