public class BasicValueValidators
extends java.lang.Object
ValueValidator implementations for some common value types| Constructor and Description |
|---|
BasicValueValidators() |
| Modifier and Type | Method and Description |
|---|---|
static ValueValidator |
getBooleanValidator() |
static ValueValidator |
getFilePathValidator() |
static ValueValidator |
getRangedIntegerValidator(int low,
int high)
Returns a
ValueValidator that checks if an object represents a
valid integer (it is a Integer or Long or a String representation of
one), within the given range. |
static ValueValidator |
getStringValidator(java.lang.String[] validValues)
Returns a
ValueValidator that checks if an object is a string from
one of the provided Strings. |
static ValueValidator |
getUrlValidator() |
public static ValueValidator getBooleanValidator()
ValueValidator that can be used to check if an object is
a valid Booleanpublic static ValueValidator getFilePathValidator()
ValueValidator that can be used to check if an object is
a String containing a valid file path or notpublic static ValueValidator getRangedIntegerValidator(int low, int high)
ValueValidator that checks if an object represents a
valid integer (it is a Integer or Long or a String representation of
one), within the given range. The values are inclusive.low - the lowest valid valuehigh - the highest valid valuepublic static ValueValidator getStringValidator(java.lang.String[] validValues)
ValueValidator that checks if an object is a string from
one of the provided Strings.validValues - an array of Strings which are considered validpublic static ValueValidator getUrlValidator()
ValueValidator that checks if an object represents a
valid url