Package dev.dokimos.core.evaluators
Enum Class StructuralMatchMode
- All Implemented Interfaces:
Serializable,Comparable<StructuralMatchMode>,Constable
Controls how
StructuralMatchEvaluator compares an expected JSON structure against an actual
one.
Both modes are numeric-value-aware: a number compares by value, not by representation, so
5 and 5.0 (and 1.0 versus 1.00) always match in either mode. The modes
differ only on how they treat object field sets and array ordering.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic StructuralMatchModeReturns the enum constant of this class with the specified name.static StructuralMatchMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
STRICT
Strict comparison (the eval-safe default).- Objects must have the exact same set of fields — an extra field in the actual output is a mismatch and penalizes the score.
- Arrays must match element-for-element in the same order.
- A
nullvalue and a missing field are distinct.
-
LENIENT
Lenient comparison.- Extra fields in the actual output are ignored (the actual may be a superset of the expected object).
- Array order is ignored, but multiplicity is not — arrays are compared as multisets, so
[1, 1, 2]does not match[1, 2]. - A
nullvalue and a missing field are treated as equal.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-