Class ParameterTypeValidator


  • public class ParameterTypeValidator
    extends Object
    Interface for declaration of method for validate a specific parameter type.
    If you want to implement your own type validator, you need only to implement isValid(java.lang.String):
    • If parameter is valid, call to put value (maybe modified) inside RequestParameters. The validation flow will care about set parameter name
    • If parameter is invalid, throw a new ValidationException with message (ValidationException) and/or with ValidationException.ErrorType (). As for value, the validation flow will care about setting all other ValidationException fields

    NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

    • Constructor Detail

      • ParameterTypeValidator

        public ParameterTypeValidator​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isValid

        @Deprecated
        public RequestParameter isValid​(String value)
        Deprecated.
        Function that checks if parameter is valid. It returns a RequestParameter object that will be linked inside . For more info, check .
        Parameters:
        value - value of parameter to test
        Returns:
        request parameter value
      • isValidCollection

        @Deprecated
        public RequestParameter isValidCollection​(List<String> value)
        Deprecated.
        Function that checks if array of values of a specific parameter. It returns a RequestParameter object that will be linked inside . For more info, check .
        Parameters:
        value - list of values of parameter to test
        Returns:
        request parameter value
      • getDefault

        @Deprecated
        public Object getDefault()
        Deprecated.
        Returns default value of parameter
        Returns:
      • hasDefault

        @Deprecated
        public boolean hasDefault()
        Deprecated.
        Returns true if this type validator has default value
        Returns:
      • createIntegerTypeValidator

        @Deprecated
        public static ParameterTypeValidator createIntegerTypeValidator​(Double maximum,
                                                                        Double minimum,
                                                                        Double multipleOf,
                                                                        Integer defaultValue)
        Deprecated.
        Create a new type validator for integer values
        Parameters:
        maximum - Maximum value. It can be null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createIntegerTypeValidator

        @Deprecated
        public static ParameterTypeValidator createIntegerTypeValidator​(Boolean exclusiveMaximum,
                                                                        Double maximum,
                                                                        Boolean exclusiveMinimum,
                                                                        Double minimum,
                                                                        Double multipleOf,
                                                                        Object defaultValue)
        Deprecated.
        Create a new type validator for integer values
        Parameters:
        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 null
        maximum - Maximum value. It can be null
        exclusiveMinimum - 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 null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createLongTypeValidator

        @Deprecated
        public static ParameterTypeValidator createLongTypeValidator​(Long defaultValue)
        Deprecated.
        Create a new type validator for long integer values
        Parameters:
        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 null
        Returns:
      • createLongTypeValidator

        @Deprecated
        public static ParameterTypeValidator createLongTypeValidator​(Double maximum,
                                                                     Double minimum,
                                                                     Double multipleOf,
                                                                     Long defaultValue)
        Deprecated.
        Create a new type validator for long integer values
        Parameters:
        maximum - Maximum value. It can be null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createLongTypeValidator

        @Deprecated
        public static ParameterTypeValidator createLongTypeValidator​(Boolean exclusiveMaximum,
                                                                     Double maximum,
                                                                     Boolean exclusiveMinimum,
                                                                     Double minimum,
                                                                     Double multipleOf,
                                                                     Object defaultValue)
        Deprecated.
        Create a new type validator for long integer values
        Parameters:
        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 null
        maximum - Maximum value. It can be null
        exclusiveMinimum - 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 null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createFloatTypeValidator

        @Deprecated
        public static ParameterTypeValidator createFloatTypeValidator​(Double maximum,
                                                                      Double minimum,
                                                                      Double multipleOf,
                                                                      Float defaultValue)
        Deprecated.
        Create a new type validator for float values
        Parameters:
        maximum - Maximum value. It can be null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createFloatTypeValidator

        @Deprecated
        public static ParameterTypeValidator createFloatTypeValidator​(Boolean exclusiveMaximum,
                                                                      Double maximum,
                                                                      Boolean exclusiveMinimum,
                                                                      Double minimum,
                                                                      Double multipleOf,
                                                                      Object defaultValue)
        Deprecated.
        Create a new type validator for float values
        Parameters:
        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 null
        maximum - Maximum value. It can be null
        exclusiveMinimum - 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 null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createDoubleTypeValidator

        @Deprecated
        public static ParameterTypeValidator createDoubleTypeValidator​(Double maximum,
                                                                       Double minimum,
                                                                       Double multipleOf,
                                                                       Double defaultValue)
        Deprecated.
        Create a new type validator for double values
        Parameters:
        maximum - Maximum value. It can be null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createDoubleTypeValidator

        @Deprecated
        public static ParameterTypeValidator createDoubleTypeValidator​(Boolean exclusiveMaximum,
                                                                       Double maximum,
                                                                       Boolean exclusiveMinimum,
                                                                       Double minimum,
                                                                       Double multipleOf,
                                                                       Object defaultValue)
        Deprecated.
        Create a new type validator for double values
        Parameters:
        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 null
        maximum - Maximum value. It can be null
        exclusiveMinimum - 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 null
        minimum - Minimum value. It can be null
        multipleOf - Multiple of value. It can be null
        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 null
        Returns:
      • createStringTypeValidator

        @Deprecated
        public static ParameterTypeValidator createStringTypeValidator​(String pattern,
                                                                       Object defaultValue)
        Deprecated.
        Create a new string type validator
        Parameters:
        pattern - pattern that string have to match. It can be null
        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 null
        Returns:
      • createStringTypeValidator

        @Deprecated
        public static ParameterTypeValidator createStringTypeValidator​(String pattern,
                                                                       Integer minLength,
                                                                       Integer maxLength,
                                                                       Object defaultValue)
        Deprecated.
        Create a new string type validator
        Parameters:
        pattern - pattern that string have to match. It can be null
        minLength - Minimum length of string. It can be null
        maxLength - Maximum length of string. It can be null
        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 null
        Returns:
      • createStringEnumTypeValidator

        @Deprecated
        public static ParameterTypeValidator createStringEnumTypeValidator​(List<String> allowedValues)
        Deprecated.
        Create an enum type validator
        Parameters:
        allowedValues - allowed values. It can't be null
        Returns:
      • createEnumTypeValidatorWithInnerValidator

        @Deprecated
        public static ParameterTypeValidator createEnumTypeValidatorWithInnerValidator​(List<Object> allowedValues,
                                                                                       ParameterTypeValidator innerValidator)
        Deprecated.
        Create an enum type validator
        Parameters:
        allowedValues - allowed values. It can't be null
        innerValidator - After check if value is one of the lists, you can pass the value to an inner validator. It can be null
        Returns:
      • createArrayTypeValidator

        @Deprecated
        public static ParameterTypeValidator createArrayTypeValidator​(ParameterTypeValidator arrayMembersValidator)
        Deprecated.
        Create an array type validator
        Parameters:
        arrayMembersValidator - Type validator that describe array items. It can't be null
        Returns:
      • createArrayTypeValidator

        @Deprecated
        public static ParameterTypeValidator createArrayTypeValidator​(ParameterTypeValidator arrayMembersValidator,
                                                                      String collectionFormat,
                                                                      Integer maxItems,
                                                                      Integer minItems)
        Deprecated.
        Create an array type validator
        Parameters:
        arrayMembersValidator - Type validator that describe array items. It can't be null
        collectionFormat - String that represent a ContainerSerializationStyle. Check out ContainerSerializationStyle for more informations. The default value is "csv". It can be null
        maxItems - Maximum items in array. It can be null
        minItems - Minimum items in array. It can be null
        Returns: