Interface IValueAcceptanceCriteria
-
public interface IValueAcceptanceCriteriaInterface for defining acceptance criteria for values, used byIValueDescriptor.acceptsValue(Object, IValueAcceptanceCriteria).- Since:
- 8.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanallowExtraneousRecordFields()Controls whether extraneous fields inrecordsare allowed that are not defined in the record descriptor.booleanallowExtraneousTupleElements()Controls whether extraneous elements intuplesare allowed, i.e. values at indices larger than the highest index defined in the tuple descriptor.booleanallowExtraneousVoidValues()Whether to allow values forvoiddescriptors.booleanallowMismatchingConst()Controls whether constant values inconstantsare allowed to mismatch the defined constant value.booleanallowMissingRequiredRecordFields()Controls whetherrecordsare allowed to have missing fields that are marked as required in the record descriptor.booleanallowMissingTupleElements()Controls whethertuplesare allowed to have fewer elements than defined in the tuple descriptor.booleanallowNonStringKeys()booleanenableLargeStringInteroperability()When true,StringandLargeStringare treated as equivalent types for the purpose of value acceptance.booleanenforceListItemConformance()Controls whether each item inlistsmust conform to the defined item value descriptor.booleanenforceListLengthLowerBound()Controls whether the length oflistis enforced to not contain fewer items than the defined minimum length of the list.booleanenforceListLengthUpperBound()Controls whether the length oflistsis enforced to not contain more items than the defined maximum length of the list.booleanenforceMapValueConformance()Controls whether each value inmapsmust conform to the defined value descriptor.booleanenforceNumberRange()booleanenforceRecordOptionalFieldValueConformance()Controls whether each optional field inrecordsmust conform to the defined value descriptor.booleanenforceRecordRequiredFieldValueConformance()Controls whether each required field inrecordsmust conform to the defined value descriptor.booleanenforceStringLengthLowerBound()Controls whether the length ofstringsis enforced to not be shorter than the defined minimum length of the string.booleanenforceStringLengthUpperBound()Controls whether the length ofstringsis enforced to not be longer than the defined maximum length of the string.booleanenforceTupleElementConformance()Controls whether each element intuplesmust conform to the defined value descriptor at the respective index.IValueDescriptorTypeCoercertypeCoercer()An optional coercer that attempts to coerce values to their expected type.
-
-
-
Method Detail
-
allowExtraneousRecordFields
boolean allowExtraneousRecordFields()
Controls whether extraneous fields inrecordsare allowed that are not defined in the record descriptor.- Returns:
- true if extraneous fields are allowed, false otherwise.
-
allowExtraneousTupleElements
boolean allowExtraneousTupleElements()
Controls whether extraneous elements intuplesare allowed, i.e. values at indices larger than the highest index defined in the tuple descriptor.- Returns:
- true if extraneous elements are allowed, false otherwise.
-
allowExtraneousVoidValues
boolean allowExtraneousVoidValues()
Whether to allow values forvoiddescriptors. Void values must not have any value, i.e. must benull. This criterion controls whether such values are accepted or rejected.- Returns:
- true if void values are accepted, false otherwise.
-
allowMismatchingConst
boolean allowMismatchingConst()
Controls whether constant values inconstantsare allowed to mismatch the defined constant value. Also applies toINullValueDescriptor, which is a constant null value.- Returns:
- true if mismatching constants are allowed, false otherwise.
-
allowMissingRequiredRecordFields
boolean allowMissingRequiredRecordFields()
Controls whetherrecordsare allowed to have missing fields that are marked as required in the record descriptor.- Returns:
- true if missing required fields are allowed, false otherwise.
-
allowMissingTupleElements
boolean allowMissingTupleElements()
Controls whethertuplesare allowed to have fewer elements than defined in the tuple descriptor.- Returns:
- true if missing fields are allowed, false otherwise.
-
allowNonStringKeys
boolean allowNonStringKeys()
The keys ofmapsandrecordsmust be strings. This criterion controls whether non-string keys are ignored when checking for conformance.- Returns:
- true if non-string keys are allowed, false otherwise.
-
enableLargeStringInteroperability
boolean enableLargeStringInteroperability()
When true,StringandLargeStringare treated as equivalent types for the purpose of value acceptance. This allows, for example, aIStringValueDescriptorto accept aLargeStringvalue.- Returns:
- true if interoperability is enabled, false otherwise.
-
enforceListItemConformance
boolean enforceListItemConformance()
Controls whether each item inlistsmust conform to the defined item value descriptor.- Returns:
- true if each item must conform, false otherwise.
-
enforceListLengthLowerBound
boolean enforceListLengthLowerBound()
Controls whether the length oflistis enforced to not contain fewer items than the defined minimum length of the list.- Returns:
- true if the list length lower bound is enforced, false otherwise.
-
enforceListLengthUpperBound
boolean enforceListLengthUpperBound()
Controls whether the length oflistsis enforced to not contain more items than the defined maximum length of the list.- Returns:
- true if the list length upper bound is enforced, false otherwise.
-
enforceMapValueConformance
boolean enforceMapValueConformance()
Controls whether each value inmapsmust conform to the defined value descriptor.- Returns:
- true if each value must conform, false otherwise.
-
enforceNumberRange
boolean enforceNumberRange()
Controls whether the value ofintegersandfloatsis enforced to be within the defined minimum and maximum value of the number.- Returns:
- true if the number range is enforced, false otherwise.
-
enforceRecordOptionalFieldValueConformance
boolean enforceRecordOptionalFieldValueConformance()
Controls whether each optional field inrecordsmust conform to the defined value descriptor.- Returns:
- true if each optional field must conform, false otherwise.
-
enforceRecordRequiredFieldValueConformance
boolean enforceRecordRequiredFieldValueConformance()
Controls whether each required field inrecordsmust conform to the defined value descriptor.- Returns:
- true if each required field must conform, false otherwise.
-
enforceStringLengthLowerBound
boolean enforceStringLengthLowerBound()
Controls whether the length ofstringsis enforced to not be shorter than the defined minimum length of the string.- Returns:
- true if the list length lower bound is enforced, false otherwise.
-
enforceStringLengthUpperBound
boolean enforceStringLengthUpperBound()
Controls whether the length ofstringsis enforced to not be longer than the defined maximum length of the string.- Returns:
- true if the list length upper bound is enforced, false otherwise.
-
enforceTupleElementConformance
boolean enforceTupleElementConformance()
Controls whether each element intuplesmust conform to the defined value descriptor at the respective index.- Returns:
- true if each element must conform, false otherwise.
-
typeCoercer
IValueDescriptorTypeCoercer typeCoercer()
An optional coercer that attempts to coerce values to their expected type. For example, a floating-point number may be coerced to an integer by truncating the decimal part; or a string representing a number may be coerced to an actual numeric type.- Returns:
- The coercer to use, or null to disable type coercion.
-
-