Attributes
Members list
Type members
Classlikes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Validator[T]class Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Validator[TT]class Objecttrait Matchableclass AnyShow all
Types
Value members
Concrete methods
Create a custom validator.
Create a custom validator.
Value parameters
- showMessage
-
Description of the validator used when invoking Validator.show.
- validationLogic
-
The logic of the validator
Attributes
Create an enumeration validator, with the given possible values.
Create an enumeration validator, with the given possible values.
To represent the enumerated values in documentation, an encoding function needs to be provided. This can be done:
- by using the overloaded enumeration method with an
encode
parameter - by adding an encode function on an Validator.Enumeration instance using one of the
.encode
functions - by adding the validator directly to a codec (see Mapping.addEncodeToEnumValidator)
- when the values possible values are of a basic type (numbers, strings), the encode function is inferred if not present, when being added to the schema, see Schema.validate
Attributes
Create an enumeration validator, with the given possible values, an optional encoding function (so that the enumerated values can be represented in documentation), and an optional name (to create a reusable documentation component).
Create an enumeration validator, with the given possible values, an optional encoding function (so that the enumerated values can be represented in documentation), and an optional name (to create a reusable documentation component).
Value parameters
- encode
-
Specify how values of this type can be encoded to a raw value, which will be used for documentation.
Attributes
Create a validator for fixed length constraints on strings.
Create a validator for fixed length constraints on strings.
Value parameters
- value
-
The fixed allowed length.
Attributes
Create a validator for fixed length constraints on strings.
Create a validator for fixed length constraints on strings.
Value parameters
- countCodePoints
-
A boolean parameter that determines whether the validation will consider code points or character count. When set to true, the validator will consider characters that are represented using two code units (a surrogate pair) in UTF-16 encoding allowing for a more accurate length validation for strings containing such characters (like emojis). Defaults to false, where length is validated based on the number of
Char
values in the string. - value
-
The fixed allowed length.
Attributes
Create a validator for maximum length constraints on strings.
Create a validator for maximum length constraints on strings.
Value parameters
- value
-
The maximum allowed length.
Attributes
Create a validator for maximum length constraints on strings.
Create a validator for maximum length constraints on strings.
Value parameters
- countCodePoints
-
A boolean parameter that determines whether the validation will consider code points or character count. When set to true, the validator will consider characters that are represented using two code units (a surrogate pair) in UTF-16 encoding allowing for a more accurate length validation for strings containing such characters (like emojis). Defaults to false, where length is validated based on the number of
Char
values in the string. - value
-
The maximum allowed length.
Attributes
Create a validator for minimum length constraints on strings.
Create a validator for minimum length constraints on strings.
Value parameters
- value
-
The minimum allowed length.
Attributes
Create a validator for minimum length constraints on strings.
Create a validator for minimum length constraints on strings.
Value parameters
- countCodePoints
-
A boolean parameter that determines whether the validation will consider code points or character count. When set to true, the validator will consider characters that are represented using two code units (a surrogate pair) in UTF-16 encoding allowing for a more accurate length validation for strings containing such characters (like emojis). Defaults to false, where length is validated based on the number of
Char
values in the string. - value
-
The minimum allowed length.
Attributes
A validator instance that always pass.
A validator instance that always pass.
Attributes
A validator instance that always reject.
A validator instance that always reject.
Attributes
Inherited methods
Creates an enum validator for an enum
where all cases are parameterless, or where all subtypes of the sealed hierarchy T
are object
s. This enumeration will only be used for documentation, as a value outside of the allowed values will not be decoded in the first place (the decoder has no other option than to fail).
Creates an enum validator for an enum
where all cases are parameterless, or where all subtypes of the sealed hierarchy T
are object
s. This enumeration will only be used for documentation, as a value outside of the allowed values will not be decoded in the first place (the decoder has no other option than to fail).
Attributes
- Inherited from:
- ValidatorMacros