Package net.javacrumbs.jsonunit.core
Enum Option
- All Implemented Interfaces:
Serializable,Comparable<Option>,java.lang.constant.Constable
public enum Option extends Enum<Option>
Comparison options.
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description COMPARING_ONLY_STRUCTUREDeprecated.Use IGNORING_VALUES option insteadIGNORING_ARRAY_ORDERWhen comparing arrays, ignores array order.IGNORING_EXTRA_ARRAY_ITEMSPasses even if array in compared document has more items than expected.IGNORING_EXTRA_FIELDSIgnores extra fields in the actual value.IGNORING_VALUESIgnores values but fails if value types are different.TREATING_NULL_AS_ABSENTTreats null nodes in actual value as absent. -
Method Summary
-
Enum Constant Details
-
TREATING_NULL_AS_ABSENT
Treats null nodes in actual value as absent. In other words if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test. When using withinConfigurationWhen.then(Option, Option...), exact path to such nodes should be passed, which is test.b in the example above. -
IGNORING_ARRAY_ORDER
When comparing arrays, ignores array order. In other words, treats arrays as sets. -
IGNORING_EXTRA_FIELDS
Ignores extra fields in the actual value. When using withinConfigurationWhen.then(Option, Option...), path to the nodes with such fields should be passed. -
IGNORING_EXTRA_ARRAY_ITEMS
Passes even if array in compared document has more items than expected. Items are taken from the beginning of the expected array unless IGNORING_ARRAY_ORDER is specified. -
COMPARING_ONLY_STRUCTURE
Deprecated.Use IGNORING_VALUES option insteadCompares only structures. Completely ignores both values and types. Is too lenient, ignores types, preferIGNORING_VALUESinstead. -
IGNORING_VALUES
Ignores values but fails if value types are different. When using withinConfigurationWhen.then(Option, Option...), path to the node with ignored value should be passed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-