public class JsonEquals
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static JsonEquals |
between(me.doubledutch.lazyjson.LazyArray source,
me.doubledutch.lazyjson.LazyArray comparate)
Returns a new JsonEquals builder instance between two JSON arrays.
|
static JsonEquals |
between(me.doubledutch.lazyjson.LazyObject source,
me.doubledutch.lazyjson.LazyObject comparate)
Returns a new JsonEquals builder instance between two JSON objects.
|
JsonCompareResult |
compare()
Compares the source with the comparate and returns a JsonCompareResult.
|
void |
compareNode(me.doubledutch.lazyjson.LazyArray a,
me.doubledutch.lazyjson.LazyArray b)
Compares two JSON arrays, starting from the root level.
|
void |
compareNode(me.doubledutch.lazyjson.LazyArray a,
me.doubledutch.lazyjson.LazyArray b,
java.lang.String currentPath)
Compares two JSON arrays.
|
void |
compareNode(me.doubledutch.lazyjson.LazyObject a,
me.doubledutch.lazyjson.LazyObject b)
Compares two JSON objects, starting from the root level.
|
void |
compareNode(me.doubledutch.lazyjson.LazyObject a,
me.doubledutch.lazyjson.LazyObject b,
java.lang.String currentPath)
Compares two JSON objects.
|
void |
compareValues(me.doubledutch.lazyjson.LazyObject a,
me.doubledutch.lazyjson.LazyObject b,
java.lang.String fieldName,
java.lang.String currentPath)
Compares the values at the end of the JSON hierarchy (i.e.
|
static JsonEquals |
ofType(me.doubledutch.lazyjson.LazyType rootType)
Returns a new JsonEquals builder instance with the specified LazyType, being either for JSON
objects or JSON arrays.
|
static void |
setDebugMode(boolean debugMode)
Sets the global debug mode for JSON comparisons.
|
JsonEquals |
withComparate(me.doubledutch.lazyjson.LazyElement comparate)
Specifies the JSON element comparate.
|
JsonEquals |
withIgnoreFields(java.util.Set<java.lang.String> ignoreFields)
Specifies the optional fields to ignore from comparison.
|
JsonEquals |
withPruneFields(java.util.Map<java.lang.String,java.lang.String> pruneFields)
Specifies the optional fields to prune before comparison.
|
JsonEquals |
withSource(me.doubledutch.lazyjson.LazyElement source)
Specifies the source JSON element.
|
public static JsonEquals ofType(me.doubledutch.lazyjson.LazyType rootType)
rootType
- The type of the JSON element, specified as either an object or arraypublic static JsonEquals between(me.doubledutch.lazyjson.LazyObject source, me.doubledutch.lazyjson.LazyObject comparate)
source
- The JSON object sourcecomparate
- The JSON object to be compared topublic static JsonEquals between(me.doubledutch.lazyjson.LazyArray source, me.doubledutch.lazyjson.LazyArray comparate)
source
- The JSON array sourcecomparate
- The JSON array to be compared topublic JsonEquals withSource(me.doubledutch.lazyjson.LazyElement source)
source
- The JSON element sourcepublic JsonEquals withComparate(me.doubledutch.lazyjson.LazyElement comparate)
comparate
- The JSON element to compare topublic JsonEquals withIgnoreFields(java.util.Set<java.lang.String> ignoreFields)
ignoreFields
- The set of JSON node paths to ignore from comparisonpublic JsonEquals withPruneFields(java.util.Map<java.lang.String,java.lang.String> pruneFields)
pruneFields
- The predicate map of JSON node paths to expected values that need to be
pruned before comparisonpublic JsonCompareResult compare()
public void compareNode(me.doubledutch.lazyjson.LazyObject a, me.doubledutch.lazyjson.LazyObject b)
a
- source JSON objectb
- comparate JSON objectpublic void compareNode(me.doubledutch.lazyjson.LazyArray a, me.doubledutch.lazyjson.LazyArray b)
a
- source JSON arrayb
- comparate JSON arraypublic void compareNode(me.doubledutch.lazyjson.LazyObject a, me.doubledutch.lazyjson.LazyObject b, java.lang.String currentPath)
a
- source JSON objectb
- comparate JSON objectcurrentPath
- The current JSON node pathpublic void compareNode(me.doubledutch.lazyjson.LazyArray a, me.doubledutch.lazyjson.LazyArray b, java.lang.String currentPath)
a
- source JSON arrayb
- comparate JSON arraycurrentPath
- The current JSON node pathpublic void compareValues(me.doubledutch.lazyjson.LazyObject a, me.doubledutch.lazyjson.LazyObject b, java.lang.String fieldName, java.lang.String currentPath)
a
- the value from the sourceb
- the value from the comparatefieldName
- the name of the JSON field which holds this valuecurrentPath
- The current JSON node pathpublic static void setDebugMode(boolean debugMode)
debugMode
- the debug mode boolean value