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.
Modifier and Type | Class and Description |
---|---|
static interface |
ConfigValidationAnnotations.CustomValidator
For custom validators
|
static interface |
ConfigValidationAnnotations.isBoolean |
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.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 and Description |
---|
ConfigValidationAnnotations() |
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.