Package google.registry.util
Class DiffUtils
java.lang.Object
google.registry.util.DiffUtils
Helper class for diff utilities.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
A helper record to store the two sides of a diff. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.collect.ImmutableMap
<?, ?> Compare two maps and return a map containing, at each key where they differed, both values.static String
prettyPrintDiffedMap
(Map<?, ?> map, String path) Recursively pretty prints the contents of a diffed map generated bydeepDiff(java.util.Map<?, ?>, java.util.Map<?, ?>, boolean)
.static String
prettyPrintEntityDeepDiff
(Map<?, ?> a, Map<?, ?> b) Pretty-prints a deep diff between two maps that represent entities.static String
prettyPrintXmlDeepDiff
(Map<?, ?> a, Map<?, ?> b, String path) Pretty-prints a deep diff between two maps that represent XML documents.
-
Method Details
-
prettyPrintEntityDeepDiff
Pretty-prints a deep diff between two maps that represent entities. -
prettyPrintXmlDeepDiff
Pretty-prints a deep diff between two maps that represent XML documents. Path is prefixed to each output line of the diff. -
deepDiff
public static com.google.common.collect.ImmutableMap<?,?> deepDiff(Map<?, ?> a, Map<?, ?> b, boolean ignoreNullToCollection) Compare two maps and return a map containing, at each key where they differed, both values. -
prettyPrintDiffedMap
Recursively pretty prints the contents of a diffed map generated bydeepDiff(java.util.Map<?, ?>, java.util.Map<?, ?>, boolean)
.
-