Package org.apache.storm.validation
Class ConfigValidationAnnotations
- java.lang.Object
-
- org.apache.storm.validation.ConfigValidationAnnotations
-
public class ConfigValidationAnnotations extends Object
Note: every annotation interface must have method `validatorClass()` For every annotation there must validator class to do the validation To add another annotation for config validation, add another annotation @interface class. Implement the corresponding validator logic in a class in ConfigValidation. Make sure validateField method in ConfigValidation knows how to use the validator and which method definition/parameters to pass in based on what fields are in the annotation. By default, params of annotations will be passed into a constructor that takes a Map as a parameter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ConfigValidationAnnotations.CustomValidator
For custom validators.static interface
ConfigValidationAnnotations.IsBoolean
static interface
ConfigValidationAnnotations.IsDerivedFrom
static interface
ConfigValidationAnnotations.IsExactlyOneOf
Custom validator where exactly one of the validations must be successful.static interface
ConfigValidationAnnotations.IsImplementationOfClass
static interface
ConfigValidationAnnotations.IsInteger
static interface
ConfigValidationAnnotations.IsKryoReg
static interface
ConfigValidationAnnotations.IsListEntryCustom
Validates each entry in a list with a list of validators Validators with fields: validatorClass and entryValidatorClass.static interface
ConfigValidationAnnotations.IsListEntryType
validates each entry in a list is of a certain type.static interface
ConfigValidationAnnotations.IsLong
static interface
ConfigValidationAnnotations.IsMapEntryCustom
Validates a each key and value in a Map with a list of validators Validator with fields: validatorClass, keyValidatorClasses, valueValidatorClasses.static interface
ConfigValidationAnnotations.IsMapEntryType
Validates the type of each key and value in a map Validator with fields: validatorClass, keyValidatorClass, valueValidatorClass.static interface
ConfigValidationAnnotations.IsNoDuplicateInList
Validates that there are no duplicates in a list.static interface
ConfigValidationAnnotations.IsNumber
static interface
ConfigValidationAnnotations.IsPositiveNumber
Checks if a number is positive and whether zero inclusive Validator with fields: validatorClass, includeZero.static interface
ConfigValidationAnnotations.IsPowerOf2
static interface
ConfigValidationAnnotations.IsString
Validators with fields: validatorClass.static interface
ConfigValidationAnnotations.IsStringList
static interface
ConfigValidationAnnotations.IsStringOrStringList
Complex/custom type validators.static interface
ConfigValidationAnnotations.IsType
Validators with fields: validatorClass and type.static interface
ConfigValidationAnnotations.NotNull
Validates on object is not null.static interface
ConfigValidationAnnotations.Password
static class
ConfigValidationAnnotations.ValidatorParams
Field names for annotations.
-
Constructor Summary
Constructors Constructor Description ConfigValidationAnnotations()
-