Package io.debezium.config
Interface Field.Validator
-
- All Known Implementing Classes:
Field.EnumRecommender,Field.RangeValidator
- Enclosing class:
- Field
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface Field.Validator
A functional interface that can be used to validate field values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Field.Validatorand(Field.Validator other)Obtain a newField.Validatorobject that validates using this validator and the supplied validator.intvalidate(Configuration config, Field field, Field.ValidationOutput problems)Validate the supplied value for the field, and report any problems to the designated consumer.
-
-
-
Method Detail
-
validate
int validate(Configuration config, Field field, Field.ValidationOutput problems)
Validate the supplied value for the field, and report any problems to the designated consumer.- Parameters:
config- the configuration containing the field to be validated; may not be nullfield- theFieldbeing validated; never nullproblems- the consumer to be called with each problem; never null- Returns:
- the number of problems that were found, or 0 if the value is valid
-
and
default Field.Validator and(Field.Validator other)
Obtain a newField.Validatorobject that validates using this validator and the supplied validator.- Parameters:
other- the validation function to call after this- Returns:
- the new validator, or this validator if
otherisnullor equal tothis
-
-