@InterfaceAudience.Public @InterfaceStability.Evolving public class IntegerConfigurationBasicValidator extends Object implements ConfigurationValidator
| Constructor and Description |
|---|
IntegerConfigurationBasicValidator(int min,
int max,
int defaultVal,
String configKey,
boolean throwIfInvalid) |
| Modifier and Type | Method and Description |
|---|---|
String |
getConfigKey() |
T |
getDefaultVal() |
boolean |
getThrowIfInvalid() |
Integer |
validate(String configValue)
This method handles the base case where the configValue is null, based on the throwIfInvalid it either throws or returns the defaultVal,
otherwise it returns null indicating that the configValue needs to be validated further.
|
public IntegerConfigurationBasicValidator(int min,
int max,
int defaultVal,
String configKey,
boolean throwIfInvalid)
public Integer validate(String configValue) throws InvalidConfigurationValueException
validate in interface ConfigurationValidatorconfigValue - the configuration value set by the userInvalidConfigurationValueException - in case the configValue is null and required to be setpublic T getDefaultVal()
public String getConfigKey()
public boolean getThrowIfInvalid()
Copyright © 2008–2020 Apache Software Foundation. All rights reserved.