Package org.apache.storm.validation
Class ConfigValidationUtils
java.lang.Object
org.apache.storm.validation.ConfigValidationUtils
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Declares methods for validating configuration values.static class
Declares a method for validating configuration values that is nestable. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a new NestableFieldValidator for a given class.Returns a new NestableFieldValidator for a List of the given Class.listFv
(ConfigValidationUtils.NestableFieldValidator validator, boolean notNull) Returns a new NestableFieldValidator for a List where each item is validated by validator.Returns a new NestableFieldValidator for a Map of key to val.mapFv
(ConfigValidationUtils.NestableFieldValidator key, ConfigValidationUtils.NestableFieldValidator val, boolean notNull) Returns a new NestableFieldValidator for a Map.
-
Constructor Details
-
ConfigValidationUtils
public ConfigValidationUtils()
-
-
Method Details
-
fv
Returns a new NestableFieldValidator for a given class.- Parameters:
cls
- the Class the field should be a type ofnotNull
- whether or not a value of null is valid- Returns:
- a NestableFieldValidator for that class
-
listFv
Returns a new NestableFieldValidator for a List of the given Class.- Parameters:
cls
- the Class of elements composing the listnotNull
- whether or not a value of null is valid- Returns:
- a NestableFieldValidator for a list of the given class
-
listFv
public static ConfigValidationUtils.NestableFieldValidator listFv(ConfigValidationUtils.NestableFieldValidator validator, boolean notNull) Returns a new NestableFieldValidator for a List where each item is validated by validator.- Parameters:
validator
- used to validate each item in the listnotNull
- whether or not a value of null is valid- Returns:
- a NestableFieldValidator for a list with each item validated by a different validator.
-
mapFv
public static ConfigValidationUtils.NestableFieldValidator mapFv(Class key, Class val, boolean notNull) Returns a new NestableFieldValidator for a Map of key to val.- Parameters:
key
- the Class of keys in the mapval
- the Class of values in the mapnotNull
- whether or not a value of null is valid- Returns:
- a NestableFieldValidator for a Map of key to val
-
mapFv
public static ConfigValidationUtils.NestableFieldValidator mapFv(ConfigValidationUtils.NestableFieldValidator key, ConfigValidationUtils.NestableFieldValidator val, boolean notNull) Returns a new NestableFieldValidator for a Map.- Parameters:
key
- a validator for the keys in the mapval
- a validator for the values in the mapnotNull
- whether or not a value of null is valid- Returns:
- a NestableFieldValidator for a Map
-