public class ParameterTypeValidator extends Object
isValid(java.lang.String)
:
ValidationException
) and/or with
ValidationException.ErrorType
(). As for value, the
validation flow will care about setting all other ValidationException fieldsoriginal
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<ParameterTypeValidator> |
__TYPE_ARG |
Constructor and Description |
---|
ParameterTypeValidator(Object delegate) |
ParameterTypeValidator(ParameterTypeValidator delegate) |
Modifier and Type | Method and Description |
---|---|
static ParameterTypeValidator |
createArrayTypeValidator(ParameterTypeValidator arrayMembersValidator)
Create an array type validator
|
static ParameterTypeValidator |
createArrayTypeValidator(ParameterTypeValidator arrayMembersValidator,
String collectionFormat,
Integer maxItems,
Integer minItems)
Create an array type validator
|
static ParameterTypeValidator |
createBooleanTypeValidator(Object defaultValue)
Create a boolean type validator
|
static ParameterTypeValidator |
createDoubleTypeValidator(Boolean exclusiveMaximum,
Double maximum,
Boolean exclusiveMinimum,
Double minimum,
Double multipleOf,
Object defaultValue)
Create a new type validator for double values
|
static ParameterTypeValidator |
createDoubleTypeValidator(Double defaultValue)
Create a new type validator for double values
|
static ParameterTypeValidator |
createDoubleTypeValidator(Double maximum,
Double minimum,
Double multipleOf,
Double defaultValue)
Create a new type validator for double values
|
static ParameterTypeValidator |
createEnumTypeValidatorWithInnerValidator(List<Object> allowedValues,
ParameterTypeValidator innerValidator)
Create an enum type validator
|
static ParameterTypeValidator |
createFloatTypeValidator(Boolean exclusiveMaximum,
Double maximum,
Boolean exclusiveMinimum,
Double minimum,
Double multipleOf,
Object defaultValue)
Create a new type validator for float values
|
static ParameterTypeValidator |
createFloatTypeValidator(Double maximum,
Double minimum,
Double multipleOf,
Float defaultValue)
Create a new type validator for float values
|
static ParameterTypeValidator |
createFloatTypeValidator(Float defaultValue)
Create a new type validator for float values
|
static ParameterTypeValidator |
createIntegerTypeValidator(Boolean exclusiveMaximum,
Double maximum,
Boolean exclusiveMinimum,
Double minimum,
Double multipleOf,
Object defaultValue)
Create a new type validator for integer values
|
static ParameterTypeValidator |
createIntegerTypeValidator(Double maximum,
Double minimum,
Double multipleOf,
Integer defaultValue)
Create a new type validator for integer values
|
static ParameterTypeValidator |
createIntegerTypeValidator(Integer defaultValue)
Create a new type validator for integer values
|
static ParameterTypeValidator |
createLongTypeValidator(Boolean exclusiveMaximum,
Double maximum,
Boolean exclusiveMinimum,
Double minimum,
Double multipleOf,
Object defaultValue)
Create a new type validator for long integer values
|
static ParameterTypeValidator |
createLongTypeValidator(Double maximum,
Double minimum,
Double multipleOf,
Long defaultValue)
Create a new type validator for long integer values
|
static ParameterTypeValidator |
createLongTypeValidator(Long defaultValue)
Create a new type validator for long integer values
|
static ParameterTypeValidator |
createStringEnumTypeValidator(List<String> allowedValues)
Create an enum type validator
|
static ParameterTypeValidator |
createStringTypeValidator(Object defaultValue)
Create a new string type validator
|
static ParameterTypeValidator |
createStringTypeValidator(String pattern,
Integer minLength,
Integer maxLength,
Object defaultValue)
Create a new string type validator
|
static ParameterTypeValidator |
createStringTypeValidator(String pattern,
Object defaultValue)
Create a new string type validator
|
boolean |
equals(Object o) |
Object |
getDefault()
Returns default value of parameter
|
ParameterTypeValidator |
getDelegate() |
boolean |
hasDefault()
Returns true if this type validator has default value
|
int |
hashCode() |
RequestParameter |
isValid(String value)
Function that checks if parameter is valid.
|
RequestParameter |
isValidCollection(List<String> value)
Function that checks if array of values of a specific parameter.
|
static ParameterTypeValidator |
newInstance(ParameterTypeValidator arg) |
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<ParameterTypeValidator> __TYPE_ARG
public ParameterTypeValidator(ParameterTypeValidator delegate)
public ParameterTypeValidator(Object delegate)
public ParameterTypeValidator getDelegate()
public RequestParameter isValid(String value)
value
- value of parameter to testpublic RequestParameter isValidCollection(List<String> value)
value
- list of values of parameter to testpublic Object getDefault()
public boolean hasDefault()
public static ParameterTypeValidator createIntegerTypeValidator(Integer defaultValue)
defaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createIntegerTypeValidator(Double maximum, Double minimum, Double multipleOf, Integer defaultValue)
maximum
- Maximum value. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createIntegerTypeValidator(Boolean exclusiveMaximum, Double maximum, Boolean exclusiveMinimum, Double minimum, Double multipleOf, Object defaultValue)
exclusiveMaximum
- If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be nullmaximum
- Maximum value. It can be nullexclusiveMinimum
- If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createLongTypeValidator(Long defaultValue)
defaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createLongTypeValidator(Double maximum, Double minimum, Double multipleOf, Long defaultValue)
maximum
- Maximum value. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createLongTypeValidator(Boolean exclusiveMaximum, Double maximum, Boolean exclusiveMinimum, Double minimum, Double multipleOf, Object defaultValue)
exclusiveMaximum
- If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be nullmaximum
- Maximum value. It can be nullexclusiveMinimum
- If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createFloatTypeValidator(Float defaultValue)
defaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createFloatTypeValidator(Double maximum, Double minimum, Double multipleOf, Float defaultValue)
maximum
- Maximum value. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createFloatTypeValidator(Boolean exclusiveMaximum, Double maximum, Boolean exclusiveMinimum, Double minimum, Double multipleOf, Object defaultValue)
exclusiveMaximum
- If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be nullmaximum
- Maximum value. It can be nullexclusiveMinimum
- If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createDoubleTypeValidator(Double defaultValue)
defaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createDoubleTypeValidator(Double maximum, Double minimum, Double multipleOf, Double defaultValue)
maximum
- Maximum value. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createDoubleTypeValidator(Boolean exclusiveMaximum, Double maximum, Boolean exclusiveMinimum, Double minimum, Double multipleOf, Object defaultValue)
exclusiveMaximum
- If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be nullmaximum
- Maximum value. It can be nullexclusiveMinimum
- If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be nullminimum
- Minimum value. It can be nullmultipleOf
- Multiple of value. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createStringTypeValidator(Object defaultValue)
defaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createStringTypeValidator(String pattern, Object defaultValue)
pattern
- pattern that string have to match. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createStringTypeValidator(String pattern, Integer minLength, Integer maxLength, Object defaultValue)
pattern
- pattern that string have to match. It can be nullminLength
- Minimum length of string. It can be nullmaxLength
- Maximum length of string. It can be nulldefaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createBooleanTypeValidator(Object defaultValue)
defaultValue
- Default value that will be set if parameter is empty or not found. To apply default value you have to set ParameterValidationRule.allowEmptyValue()
true. It can be nullpublic static ParameterTypeValidator createStringEnumTypeValidator(List<String> allowedValues)
allowedValues
- allowed values. It can't be nullpublic static ParameterTypeValidator createEnumTypeValidatorWithInnerValidator(List<Object> allowedValues, ParameterTypeValidator innerValidator)
allowedValues
- allowed values. It can't be nullinnerValidator
- After check if value is one of the lists, you can pass the value to an inner validator. It can be nullpublic static ParameterTypeValidator createArrayTypeValidator(ParameterTypeValidator arrayMembersValidator)
arrayMembersValidator
- Type validator that describe array items. It can't be nullpublic static ParameterTypeValidator createArrayTypeValidator(ParameterTypeValidator arrayMembersValidator, String collectionFormat, Integer maxItems, Integer minItems)
arrayMembersValidator
- Type validator that describe array items. It can't be nullcollectionFormat
- String that represent a ContainerSerializationStyle. Check out ContainerSerializationStyle
for more informations. The default value is "csv". It can be nullmaxItems
- Maximum items in array. It can be nullminItems
- Minimum items in array. It can be nullpublic static ParameterTypeValidator newInstance(ParameterTypeValidator arg)
Copyright © 2023 Eclipse. All rights reserved.