Class TimeUnitValidator
java.lang.Object
org.jboss.as.controller.operations.validation.ModelTypeValidator
org.jboss.as.controller.operations.validation.TimeUnitValidator
- All Implemented Interfaces:
AllowedValuesValidator,ParameterValidator
ParameterValidator that validates the value is a string matching one of the TimeUnit names.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeUnitValidatorTimeUnitValidator where any TimeUnit is valid, as is an undefined valuestatic final TimeUnitValidatorTimeUnitValidator where any TimeUnit is valid, but an undefined value is notFields inherited from class org.jboss.as.controller.operations.validation.ModelTypeValidator
BIGDECIMAL_MAX, BIGDECIMAL_MIN, BIGINTEGER_MAX, BIGINTEGER_MIN, nullable, strictType, validTypes -
Constructor Summary
ConstructorsConstructorDescriptionTimeUnitValidator(boolean nullable, boolean allowExpressions) TimeUnitValidator(boolean nullable, boolean allowExpressions, TimeUnit... allowed) TimeUnitValidator(boolean nullable, TimeUnit... allowed) -
Method Summary
Modifier and TypeMethodDescriptionList<org.jboss.dmr.ModelNode>Gets the allowed values, ornullif any value is allowed.voidvalidateParameter(String parameterName, org.jboss.dmr.ModelNode value) Validate the parameter with the given name.
-
Field Details
-
ANY_REQUIRED
TimeUnitValidator where any TimeUnit is valid, but an undefined value is not -
ANY_OPTIONAL
TimeUnitValidator where any TimeUnit is valid, as is an undefined value
-
-
Constructor Details
-
TimeUnitValidator
-
TimeUnitValidator
public TimeUnitValidator(boolean nullable, boolean allowExpressions) -
TimeUnitValidator
-
-
Method Details
-
validateParameter
public void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException Description copied from class:ModelTypeValidatorValidate the parameter with the given name.- Specified by:
validateParameterin interfaceParameterValidator- Overrides:
validateParameterin classModelTypeValidator- Parameters:
parameterName- the name of the parameter. Cannot benullvalue- the parameter value. Cannot benull- Throws:
OperationFailedException- if the value is not valid
-
getAllowedValues
Description copied from interface:AllowedValuesValidatorGets the allowed values, ornullif any value is allowed.- Specified by:
getAllowedValuesin interfaceAllowedValuesValidator- Returns:
- the allowed values, or
null
-