Class TimeScaleValidator
java.lang.Object
io.aiven.commons.kafka.config.validator.TimeScaleValidator
- All Implemented Interfaces:
org.apache.kafka.common.config.ConfigDef.Validator
public class TimeScaleValidator
extends Object
implements org.apache.kafka.common.config.ConfigDef.Validator
A validator for time scales.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TimeScaleValidatorA numeric range that checks only the lower bound.static TimeScaleValidatorA numeric range that checks both the upper and lower bound.voidensureValid(String name, Object value) toString()
-
Method Details
-
atLeast
A numeric range that checks only the lower bound.- Parameters:
min- The minimum acceptable value- Returns:
- A times scale validator that requires a value of at least
min.
-
between
A numeric range that checks both the upper and lower bound.- Parameters:
min- The minimum acceptable valuemax- The maximum acceptable value- Returns:
- A scale validator that requires a value between the
minandmaxnumbers inclusive.
-
ensureValid
- Specified by:
ensureValidin interfaceorg.apache.kafka.common.config.ConfigDef.Validator
-
toString
-