public class ConfigValidation extends Object
Provides functionality for validating configuration fields.
Constructor and Description |
---|
ConfigValidation() |
Modifier and Type | Method and Description |
---|---|
static List<Class<?>> |
getConfigClasses() |
static boolean |
isFieldAllowed(Field field) |
static void |
validateField(Field field,
Map<String,Object> conf)
Validates a field given field.
|
static void |
validateField(String fieldName,
Map<String,Object> conf)
Validates a field given field name as string uses Config.java as the default config class
|
static void |
validateField(String fieldName,
Map<String,Object> conf,
List<Class<?>> configs)
Validates a field given field name as string.
|
static void |
validateFields(Map<String,Object> conf)
Validate all confs in map.
|
static void |
validateFields(Map<String,Object> conf,
List<Class<?>> classes)
Validate all confs in map.
|
static void |
validateTopoConf(Map<String,Object> topoConf)
Validate topology conf.
|
public static void validateField(String fieldName, Map<String,Object> conf)
Validates a field given field name as string uses Config.java as the default config class
fieldName
- provided as a stringconf
- map of confspublic static void validateField(String fieldName, Map<String,Object> conf, List<Class<?>> configs)
Validates a field given field name as string.
fieldName
- provided as a stringconf
- map of confsconfigs
- config classpublic static void validateField(Field field, Map<String,Object> conf)
Validates a field given field. Calls correct ValidatorField method based on which fields are declared for the corresponding annotation.
field
- field that needs to be validatedconf
- map of confspublic static void validateTopoConf(Map<String,Object> topoConf)
Validate topology conf.
topoConf
- The topology conf.public static void validateFields(Map<String,Object> conf)
Validate all confs in map.
conf
- map of configspublic static void validateFields(Map<String,Object> conf, List<Class<?>> classes)
Validate all confs in map.
conf
- map of configsclasses
- config classpublic static boolean isFieldAllowed(Field field)
Copyright © 2019 The Apache Software Foundation. All rights reserved.