Package io.debezium.config
Class Field.RangeValidator
java.lang.Object
io.debezium.config.Field.RangeValidator
- All Implemented Interfaces:
Field.Validator
- Enclosing class:
- Field
Validation logic for numeric ranges
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Field.RangeValidatorA validator that checks only the lower numerical bound.static Field.RangeValidatorA validator that checks both the upper and lower bound.voidensureValid(String name, Object o) toString()intvalidate(Configuration config, Field field, Field.ValidationOutput problems) Validate the supplied value for the field, and report any problems to the designated consumer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.debezium.config.Field.Validator
and
-
Field Details
-
min
-
max
-
-
Constructor Details
-
RangeValidator
-
-
Method Details
-
atLeast
A validator that checks only the lower numerical bound.- Parameters:
min- the minimum acceptable value; may not be null- Returns:
- the validator; never null
-
between
A validator that checks both the upper and lower bound.- Parameters:
min- the minimum acceptable value; may not be nullmax- the maximum acceptable value; may not be null- Returns:
- the validator; never null
-
validate
Description copied from interface:Field.ValidatorValidate the supplied value for the field, and report any problems to the designated consumer.- Specified by:
validatein interfaceField.Validator- 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
-
ensureValid
-
toString
-