|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.reflectionassert.difference.Difference
org.unitils.reflectionassert.difference.CollectionDifference
public class CollectionDifference
A class for holding the difference between two collections or arrays.
| Constructor Summary | |
|---|---|
CollectionDifference(String message,
Object leftValue,
Object rightValue,
List<?> leftList,
List<?> rightList)
Creates a difference. |
|
| Method Summary | ||
|---|---|---|
|
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. |
|
| Methods inherited from class org.unitils.reflectionassert.difference.Difference |
|---|
getLeftValue, getMessage, getRightValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public 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 list| Method Detail |
|---|
public 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 applicable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||