Class StringBytesLengthValidator
- java.lang.Object
-
- org.jboss.as.controller.operations.validation.ModelTypeValidator
-
- org.jboss.as.controller.operations.validation.StringBytesLengthValidator
-
- All Implemented Interfaces:
MinMaxValidator
,ParameterValidator
public class StringBytesLengthValidator extends ModelTypeValidator implements MinMaxValidator
Validates that the given parameter is a string of an allowed length in bytes.- Author:
- Stefano Maestri (c) 2011 Red Hat Inc.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
max
protected int
min
-
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 StringBytesLengthValidator(int min)
StringBytesLengthValidator(int min, boolean nullable)
StringBytesLengthValidator(int min, boolean nullable, boolean allowExpressions)
StringBytesLengthValidator(int min, int max, boolean nullable, boolean allowExpressions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
getMax()
Gets the maximum, if there is one.Long
getMin()
Gets the minimum, if there is one.void
validateParameter(String parameterName, org.jboss.dmr.ModelNode value)
Validate the parameter with the given name.
-
-
-
Constructor Detail
-
StringBytesLengthValidator
public StringBytesLengthValidator(int min)
-
StringBytesLengthValidator
public StringBytesLengthValidator(int min, boolean nullable)
-
StringBytesLengthValidator
public StringBytesLengthValidator(int min, int max, boolean nullable, boolean allowExpressions)
-
StringBytesLengthValidator
public StringBytesLengthValidator(int min, boolean nullable, boolean allowExpressions)
-
-
Method Detail
-
validateParameter
public void validateParameter(String parameterName, org.jboss.dmr.ModelNode value) throws OperationFailedException
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
-
getMin
public Long getMin()
Description copied from interface:MinMaxValidator
Gets the minimum, if there is one.- Specified by:
getMin
in interfaceMinMaxValidator
- Returns:
- the minimum value, or
null
if there is no minimum
-
getMax
public Long getMax()
Description copied from interface:MinMaxValidator
Gets the maximum, if there is one.- Specified by:
getMax
in interfaceMinMaxValidator
- Returns:
- the maximum value, or
null
if there is no minimum
-
-