Class ScaleValidator
java.lang.Object
io.aiven.commons.kafka.config.validator.ScaleValidator
- All Implemented Interfaces:
org.apache.kafka.common.config.ConfigDef.Validator
public class ScaleValidator
extends Object
implements org.apache.kafka.common.config.ConfigDef.Validator
Validates input is within ranges for specific scale values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScaleValidatorA scale range that checks only the lower boundstatic ScaleValidatorA scale range that checks both the upper and lower bound.voidensureValid(String name, Object value) toString()
-
Method Details
-
atLeast
A scale range that checks only the lower bound- Parameters:
min- The minimum acceptable number of bytespossibleScales- The list of potential scale values.- Returns:
- A scale validator that requires at least the
minnumber.
-
between
A scale range that checks both the upper and lower bound.- Parameters:
min- the minimum acceptable number of bytes.max- the maximum acceptable number of bytes.possibleScales- The list of potential scale values.- Returns:
- A scale validator that requires a value between the
minandmaxnumbers inclusive.
-
ensureValid
- Specified by:
ensureValidin interfaceorg.apache.kafka.common.config.ConfigDef.Validator
-
toString
-