Interface IValueAcceptanceCriteria
public interface IValueAcceptanceCriteria
Interface for defining acceptance criteria for values, used by
IValueDescriptor.acceptsValue(Object, IValueAcceptanceCriteria).- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanControls whether extraneous fields inrecordsare allowed that are not defined in the record descriptor.booleanControls whether extraneous elements intuplesare allowed, i.e. values at indices larger than the highest index defined in the tuple descriptor.booleanWhether to allow values forvoiddescriptors.booleanControls whether constant values inconstantsare allowed to mismatch the defined constant value.booleanControls whetherrecordsare allowed to have missing fields that are marked as required in the record descriptor.booleanControls whethertuplesare allowed to have fewer elements than defined in the tuple descriptor.booleanbooleanWhen true,StringandLargeStringare treated as equivalent types for the purpose of value acceptance.booleanControls whether each item inlistsmust conform to the defined item value descriptor.booleanControls whether the length oflistis enforced to not contain fewer items than the defined minimum length of the list.booleanControls whether the length oflistsis enforced to not contain more items than the defined maximum length of the list.booleanControls whether each value inmapsmust conform to the defined value descriptor.booleanbooleanControls whether each optional field inrecordsmust conform to the defined value descriptor.booleanControls whether each required field inrecordsmust conform to the defined value descriptor.booleanControls whether the length ofstringsis enforced to not be shorter than the defined minimum length of the string.booleanControls whether the length ofstringsis enforced to not be longer than the defined maximum length of the string.booleanControls whether each element intuplesmust conform to the defined value descriptor at the respective index.An optional coercer that attempts to coerce values to their expected type.
-
Method Details
-
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
-
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
-
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.
-