Interface Unmatched
- All Known Implementing Classes:
Unmatched.Absent, Unmatched.Computed, Unmatched.Delegate, Unmatched.Fail, Unmatched.Fixed, Unmatched.Identity
public sealed interface Unmatched
permits Unmatched.Absent, Unmatched.Identity, Unmatched.Fixed, Unmatched.Computed, Unmatched.Fail, Unmatched.Delegate
What a
Mapping answers with when the requested key has no entry.
Every mode but Unmatched.Delegate answers on its own; Unmatched.Delegate hands the question to
another mapping, whose own fallback then decides.
This replaces the (ELSE) clause of the Groovy mapping DSL, whose value could be
any Groovy expression. The vocabulary here is closed and therefore exhaustively checkable:
a mapping file can only declare one of the modes below, and Unmatched.Computed can only name
a function that a MappingFunctionRegistry knows about.
- Since:
- 6.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordNo fallback — an unmatched key has no value.static final recordThe value is computed by a named function resolved against aMappingFunctionRegistry.static final recordAnother mapping answers instead.static final recordAn unmatched key is an error.static final recordA constant value.static final recordThe key itself is the value. -
Field Summary
Fields -
Method Summary
-
Field Details
-
ABSENT
-
IDENTITY
-
FAIL
-
-
Method Details
-
fixed
-
computed
-
delegate
-