Class LongRangeValidator
java.lang.Object
org.jboss.as.controller.operations.validation.ModelTypeValidator
org.jboss.as.controller.operations.validation.LongRangeValidator
- All Implemented Interfaces:
MinMaxValidator,ParameterValidator
Validates that the given parameter is a long in a given range.
- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longprotected final longstatic final ParameterValidatorValidates that a parameter is a long greater than or equal to zero.static final ParameterValidatorValidates that a parameter is a long greater than zero.Fields inherited from class org.jboss.as.controller.operations.validation.ModelTypeValidator
BIGDECIMAL_MAX, BIGDECIMAL_MIN, BIGINTEGER_MAX, BIGINTEGER_MIN, nullable, strictType, validTypes -
Constructor Summary
ConstructorsConstructorDescriptionLongRangeValidator(long min) LongRangeValidator(long min, boolean nullable) LongRangeValidator(long min, long max, boolean nullable, boolean allowExpressions) LongRangeValidator(long min, Long max) -
Method Summary
-
Field Details
-
NON_NEGATIVE
Validates that a parameter is a long greater than or equal to zero. -
POSITIVE
Validates that a parameter is a long greater than zero. -
min
protected final long min -
max
protected final long max
-
-
Constructor Details
-
LongRangeValidator
public LongRangeValidator(long min) -
LongRangeValidator
-
LongRangeValidator
public LongRangeValidator(long min, boolean nullable) -
LongRangeValidator
public LongRangeValidator(long min, long max, boolean nullable, boolean allowExpressions)
-
-
Method Details
-
validateParameter
public void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException Validate 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
-
getMin
Description copied from interface:MinMaxValidatorGets the minimum, if there is one.- Specified by:
getMinin interfaceMinMaxValidator- Returns:
- the minimum value, or
nullif there is no minimum
-
getMax
Description copied from interface:MinMaxValidatorGets the maximum, if there is one.- Specified by:
getMaxin interfaceMinMaxValidator- Returns:
- the maximum value, or
nullif there is no minimum
-