Enum Option

java.lang.Object
java.lang.Enum<Option>
net.javacrumbs.jsonunit.core.Option
All Implemented Interfaces:
Serializable, Comparable<Option>, java.lang.constant.Constable

public enum Option
extends Enum<Option>
Comparison options.
  • Enum Constant Details

    • TREATING_NULL_AS_ABSENT

      public static final Option 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 within ConfigurationWhen.then(Option, Option...), exact path to such nodes should be passed, which is test.b in the example above.
    • IGNORING_ARRAY_ORDER

      public static final Option IGNORING_ARRAY_ORDER
      When comparing arrays, ignores array order. In other words, treats arrays as sets.
    • IGNORING_EXTRA_FIELDS

      public static final Option IGNORING_EXTRA_FIELDS
      Ignores extra fields in the actual value. When using within ConfigurationWhen.then(Option, Option...), path to the nodes with such fields should be passed.
    • IGNORING_EXTRA_ARRAY_ITEMS

      public static final Option 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 public static final Option COMPARING_ONLY_STRUCTURE
      Deprecated.
      Use IGNORING_VALUES option instead
      Compares only structures. Completely ignores both values and types. Is too lenient, ignores types, prefer IGNORING_VALUES instead.
    • IGNORING_VALUES

      public static final Option IGNORING_VALUES
      Ignores values but fails if value types are different. When using within ConfigurationWhen.then(Option, Option...), path to the node with ignored value should be passed.
  • Method Details

    • values

      public static Option[] 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

      public static Option valueOf​(String name)
      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 name
      NullPointerException - if the argument is null