Package io.permazen.util
Class Diffs
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Diffs>
Used to report difference(s) between two hierarchical structures.
Each individual difference is a String
(map key) and has optional further detail contained in another
Diffs
instance (map value, or null for none). Keys must not be null.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Constructor Details
-
Diffs
public Diffs()Default constructor. -
Diffs
Copy constructor. Performs a shallow copy.- Parameters:
other
- instance to copy
-
-
Method Details
-
add
Add a difference without any sub-differences.- Parameters:
description
- description of the difference- Throws:
IllegalArgumentException
- ifdescription
is null
-
add
Add a difference with optional sub-differences.- Parameters:
description
- description of the differencediffs
- sub-differences, or null for none- Throws:
IllegalArgumentException
- ifdescription
is null
-
toString
Format this instance as aString
.- Overrides:
toString
in classAbstractMap<String,
Diffs>
-