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 RangeValidatoratLeast(java.lang.Number min)A numeric range that checks the lower bound.static RangeValidatoratMost(java.lang.Number max)A numeric range that checks the upper bound.static RangeValidatorbetween(java.lang.Number min, java.lang.Number max)A numeric range that checks both lower and upper bounds.protected booleancanEqual(java.lang.Object other)java.lang.Stringdocumentation()Return the documentation for a given validator.booleanequals(java.lang.Object o)java.lang.NumbergetMax()java.lang.NumbergetMin()inthashCode()java.lang.StringtoString()booleanvalidate(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:ValidatorValidates the configuration value.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
documentation
public java.lang.String documentation()
Description copied from interface:ValidatorReturn the documentation for a given validator.- Specified by:
documentationin 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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-