Class RangeValidator
- java.lang.Object
-
- org.apache.bookkeeper.common.conf.validators.RangeValidator
-
-
Constructor Summary
Constructors Constructor Description RangeValidator(java.lang.Number min, java.lang.Number max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RangeValidator
atLeast(java.lang.Number min)
A numeric range that checks the lower bound.static RangeValidator
atMost(java.lang.Number max)
A numeric range that checks the upper bound.static RangeValidator
between(java.lang.Number min, java.lang.Number max)
A numeric range that checks both lower and upper bounds.protected boolean
canEqual(java.lang.Object other)
java.lang.String
documentation()
Return the documentation for a given validator.boolean
equals(java.lang.Object o)
java.lang.Number
getMax()
java.lang.Number
getMin()
int
hashCode()
java.lang.String
toString()
boolean
validate(java.lang.String name, java.lang.Object value)
Validates the configuration value.
-
-
-
Method Detail
-
atLeast
public static RangeValidator atLeast(java.lang.Number min)
A numeric range that checks the lower bound.- Parameters:
min
- the minimum acceptable value- Returns:
- a numeric range that checks the lower bound
-
atMost
public static RangeValidator atMost(java.lang.Number max)
A numeric range that checks the upper bound.- Parameters:
max
- the maximum acceptable value- Returns:
- a numeric range that checks the upper bound
-
between
public static RangeValidator between(java.lang.Number min, java.lang.Number max)
A numeric range that checks both lower and upper bounds.- Parameters:
min
- the minimum acceptable valuemax
- the maximum acceptable value- Returns:
- a numeric range that checks both lower and upper bounds
-
validate
public boolean validate(java.lang.String name, java.lang.Object value)
Description copied from interface:Validator
Validates the configuration value.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
documentation
public java.lang.String documentation()
Description copied from interface:Validator
Return the documentation for a given validator.- Specified by:
documentation
in interfaceValidator
- Returns:
- the documentation for a given validator
-
getMin
public java.lang.Number getMin()
-
getMax
public java.lang.Number getMax()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-