java.lang.Object
de.serra.so_dirty.difference.MapDifferenceNode
- All Implemented Interfaces:
DifferenceNode,Iterable<DifferenceNode>
Differences of a
Map.- Author:
- Peter Lamby
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.serra.so_dirty.difference.DifferenceNode
DifferenceNode.EmptyDifferenceNode -
Constructor Summary
ConstructorsConstructorDescriptionMapDifferenceNode(String name, @Nullable Set<DifferenceType> types, int removedKeys, int addedKeys, Map<@Nullable Object, DifferenceNode> differentValues) Constructs. -
Method Summary
Modifier and TypeMethodDescription@Nullable DifferenceNodegetChildNullable(String name) Gets a direct child node in the object tree.getName()The relative path inside the object tree.getTypes()Describes in what way the current node changed.iterator()<T> Tvisit(de.serra.so_dirty.difference.visit.DifferenceVisitor<T> visitor, DifferenceVisit<T> visit) Visits the current node.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.serra.so_dirty.difference.DifferenceNode
get, getChild, getTypesRecursive, isDifferent, isDifferent, isDifferentRecursiveMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MapDifferenceNode
public MapDifferenceNode(String name, @Nullable Set<DifferenceType> types, int removedKeys, int addedKeys, Map<@Nullable Object, DifferenceNode> differentValues) Constructs.- Parameters:
name- The relative path of this difference.types- The types of difference for this node. Can benull.removedKeys- How many keys were removed.addedKeys- How many keys were added.differentValues- The map entries where the value has changed.
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<DifferenceNode>
-
visit
public <T> T visit(de.serra.so_dirty.difference.visit.DifferenceVisitor<T> visitor, DifferenceVisit<T> visit) Description copied from interface:DifferenceNodeVisits the current node.The children will be visited after
thisnode has been visited.The visiting of children can be prevented by calling
DifferenceVisit.dontGoDeeper()usually from thevisitor.- Specified by:
visitin interfaceDifferenceNode- Type Parameters:
T- The return type of the visit.- Parameters:
visitor- The visitor.visit- The visit.- Returns:
- The
DifferenceVisit.value().
-
getName
Description copied from interface:DifferenceNodeThe relative path inside the object tree.- Specified by:
getNamein interfaceDifferenceNode- Returns:
- The path.
-
getTypes
Description copied from interface:DifferenceNodeDescribes in what way the current node changed. Returns an empty set if there are no changes.- Specified by:
getTypesin interfaceDifferenceNode- Returns:
- The types of change if any.
-
getChildNullable
Description copied from interface:DifferenceNodeGets a direct child node in the object tree.Will return
nullif the child does not exist.- Specified by:
getChildNullablein interfaceDifferenceNode- Parameters:
name- The name of the child node.- Returns:
- The result of the desired node. May return
null.
-