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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Field.RangeValidator
A validator that checks only the lower numerical bound.static Field.RangeValidator
A validator that checks both the upper and lower bound.void
ensureValid
(String name, Object o) toString()
int
validate
(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, wait
Methods 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.Validator
Validate the supplied value for the field, and report any problems to the designated consumer.- Specified by:
validate
in interfaceField.Validator
- Parameters:
config
- the configuration containing the field to be validated; may not be nullfield
- theField
being 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
-