Class TimeUnitValidator
- java.lang.Object
-
- org.jboss.as.controller.operations.validation.ModelTypeValidator
-
- org.jboss.as.controller.operations.validation.TimeUnitValidator
-
- All Implemented Interfaces:
AllowedValuesValidator
,ParameterValidator
public class TimeUnitValidator extends ModelTypeValidator implements AllowedValuesValidator
ParameterValidator
that validates the value is a string matching one of theTimeUnit
names.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Field Summary
Fields Modifier and Type Field Description static TimeUnitValidator
ANY_OPTIONAL
TimeUnitValidator where any TimeUnit is valid, as is an undefined valuestatic TimeUnitValidator
ANY_REQUIRED
TimeUnitValidator where any TimeUnit is valid, but an undefined value is not-
Fields inherited from class org.jboss.as.controller.operations.validation.ModelTypeValidator
BIGDECIMAL_MAX, BIGDECIMAL_MIN, BIGINTEGER_MAX, BIGINTEGER_MIN, nullable, strictType, validTypes
-
-
Constructor Summary
Constructors Constructor Description TimeUnitValidator(boolean nullable, boolean allowExpressions)
TimeUnitValidator(boolean nullable, boolean allowExpressions, TimeUnit... allowed)
TimeUnitValidator(boolean nullable, TimeUnit... allowed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.jboss.dmr.ModelNode>
getAllowedValues()
Gets the allowed values, ornull
if any value is allowed.void
validateParameter(String parameterName, org.jboss.dmr.ModelNode value)
Validate the parameter with the given name.
-
-
-
Field Detail
-
ANY_REQUIRED
public static final TimeUnitValidator ANY_REQUIRED
TimeUnitValidator where any TimeUnit is valid, but an undefined value is not
-
ANY_OPTIONAL
public static final TimeUnitValidator ANY_OPTIONAL
TimeUnitValidator where any TimeUnit is valid, as is an undefined value
-
-
Method Detail
-
validateParameter
public void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException
Description copied from class:ModelTypeValidator
Validate the parameter with the given name.- Specified by:
validateParameter
in interfaceParameterValidator
- Overrides:
validateParameter
in classModelTypeValidator
- Parameters:
parameterName
- the name of the parameter. Cannot benull
value
- the parameter value. Cannot benull
- Throws:
OperationFailedException
- if the value is not valid
-
getAllowedValues
public List<org.jboss.dmr.ModelNode> getAllowedValues()
Description copied from interface:AllowedValuesValidator
Gets the allowed values, ornull
if any value is allowed.- Specified by:
getAllowedValues
in interfaceAllowedValuesValidator
- Returns:
- the allowed values, or
null
-
-