Class: VertxWebApiContract::ParameterTypeValidator

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb

Overview

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 #is_valid:
  • 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 () and/or with ErrorType (). As for value, the validation flow will care about setting all other ValidationException fields

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


29
30
31
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 29

def @@j_api_type.accept?(obj)
  obj.class == ParameterTypeValidator
end

+ (::VertxWebApiContract::ParameterTypeValidator) create_array_type_validator(arrayMembersValidator = nil, collectionFormat = nil, maxItems = nil, minItems = nil)

Create an array type validator

Parameters:

  • arrayMembersValidator (::VertxWebApiContract::ParameterTypeValidator) (defaults to: nil)
    Type validator that describe array items. It can't be null
  • collectionFormat (String) (defaults to: nil)
    String that represent a ContainerSerializationStyle. Check out ContainerSerializationStyle for more informations. The default value is "csv". It can be null
  • maxItems (Fixnum) (defaults to: nil)
    Maximum items in array. It can be null
  • minItems (Fixnum) (defaults to: nil)
    Minimum items in array. It can be null

Returns:

Raises:

  • (ArgumentError)


232
233
234
235
236
237
238
239
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 232

def self.create_array_type_validator(arrayMembersValidator=nil,collectionFormat=nil,maxItems=nil,minItems=nil)
  if arrayMembersValidator.class.method_defined?(:j_del) && !block_given? && collectionFormat == nil && maxItems == nil && minItems == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createArrayTypeValidator, [Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_class]).call(arrayMembersValidator.j_del),::VertxWebApiContract::ParameterTypeValidator)
  elsif arrayMembersValidator.class.method_defined?(:j_del) && collectionFormat.class == String && maxItems.class == Fixnum && minItems.class == Fixnum && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createArrayTypeValidator, [Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_class,Java::java.lang.String.java_class,Java::JavaLang::Integer.java_class,Java::JavaLang::Integer.java_class]).call(arrayMembersValidator.j_del,collectionFormat,::Vertx::Util::Utils.to_integer(maxItems),::Vertx::Util::Utils.to_integer(minItems)),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_array_type_validator(#{arrayMembersValidator},#{collectionFormat},#{maxItems},#{minItems})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) create_boolean_type_validator(defaultValue = nil)

Create a boolean type validator

Parameters:

  • defaultValue (Object) (defaults to: nil)
    Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null

Returns:

Raises:

  • (ArgumentError)


201
202
203
204
205
206
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 201

def self.create_boolean_type_validator(defaultValue=nil)
  if ::Vertx::Util::unknown_type.accept?(defaultValue) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createBooleanTypeValidator, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(defaultValue)),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_boolean_type_validator(#{defaultValue})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) createDoubleTypeValidator(defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createDoubleTypeValidator(maximum, minimum, multipleOf, defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createDoubleTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

Create a new type validator for double values

Overloads:

  • + (::VertxWebApiContract::ParameterTypeValidator) createDoubleTypeValidator(defaultValue)

    Parameters:

    • defaultValue (Float)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createDoubleTypeValidator(maximum, minimum, multipleOf, defaultValue)

    Parameters:

    • maximum (Float)
      Maximum value. It can be null
    • minimum (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Float)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createDoubleTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

    Parameters:

    • exclusiveMaximum (true, false)
      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 (Float)
      Maximum value. It can be null
    • exclusiveMinimum (true, false)
      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 (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Object)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null

Returns:

Raises:

  • (ArgumentError)


166
167
168
169
170
171
172
173
174
175
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 166

def self.create_double_type_validator(param_1=nil,param_2=nil,param_3=nil,param_4=nil,param_5=nil,param_6=nil)
  if param_1.class == Float && !block_given? && param_2 == nil && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createDoubleTypeValidator, [Java::JavaLang::Double.java_class]).call(::Vertx::Util::Utils.to_double(param_1)),::VertxWebApiContract::ParameterTypeValidator)
  elsif param_1.class == Float && param_2.class == Float && param_3.class == Float && param_4.class == Float && !block_given? && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createDoubleTypeValidator, [Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class]).call(::Vertx::Util::Utils.to_double(param_1),::Vertx::Util::Utils.to_double(param_2),::Vertx::Util::Utils.to_double(param_3),::Vertx::Util::Utils.to_double(param_4)),::VertxWebApiContract::ParameterTypeValidator)
  elsif (param_1.class == TrueClass || param_1.class == FalseClass) && param_2.class == Float && (param_3.class == TrueClass || param_3.class == FalseClass) && param_4.class == Float && param_5.class == Float && ::Vertx::Util::unknown_type.accept?(param_6) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createDoubleTypeValidator, [Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::java.lang.Object.java_class]).call(param_1,::Vertx::Util::Utils.to_double(param_2),param_3,::Vertx::Util::Utils.to_double(param_4),::Vertx::Util::Utils.to_double(param_5),::Vertx::Util::Utils.to_object(param_6)),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_double_type_validator(#{param_1},#{param_2},#{param_3},#{param_4},#{param_5},#{param_6})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) create_enum_type_validator_with_inner_validator(allowedValues = nil, innerValidator = nil)

Create an enum type validator

Parameters:

  • allowedValues (Array<String>) (defaults to: nil)
    allowed values. It can't be null
  • innerValidator (::VertxWebApiContract::ParameterTypeValidator) (defaults to: nil)
    After check if value is one of the lists, you can pass the value to an inner validator. It can be null

Returns:

Raises:

  • (ArgumentError)


220
221
222
223
224
225
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 220

def self.create_enum_type_validator_with_inner_validator(allowedValues=nil,innerValidator=nil)
  if allowedValues.class == Array && innerValidator.class.method_defined?(:j_del) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createEnumTypeValidatorWithInnerValidator, [Java::JavaUtil::List.java_class,Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_class]).call(allowedValues.map { |element| element },innerValidator.j_del),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_enum_type_validator_with_inner_validator(#{allowedValues},#{innerValidator})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) createFloatTypeValidator(defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createFloatTypeValidator(maximum, minimum, multipleOf, defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createFloatTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

Create a new type validator for float values

Overloads:

  • + (::VertxWebApiContract::ParameterTypeValidator) createFloatTypeValidator(defaultValue)

    Parameters:

    • defaultValue (Float)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createFloatTypeValidator(maximum, minimum, multipleOf, defaultValue)

    Parameters:

    • maximum (Float)
      Maximum value. It can be null
    • minimum (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Float)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createFloatTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

    Parameters:

    • exclusiveMaximum (true, false)
      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 (Float)
      Maximum value. It can be null
    • exclusiveMinimum (true, false)
      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 (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Object)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null

Returns:

Raises:

  • (ArgumentError)


140
141
142
143
144
145
146
147
148
149
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 140

def self.create_float_type_validator(param_1=nil,param_2=nil,param_3=nil,param_4=nil,param_5=nil,param_6=nil)
  if param_1.class == Float && !block_given? && param_2 == nil && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createFloatTypeValidator, [Java::JavaLang::Float.java_class]).call(::Vertx::Util::Utils.to_float(param_1)),::VertxWebApiContract::ParameterTypeValidator)
  elsif param_1.class == Float && param_2.class == Float && param_3.class == Float && param_4.class == Float && !block_given? && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createFloatTypeValidator, [Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Float.java_class]).call(::Vertx::Util::Utils.to_double(param_1),::Vertx::Util::Utils.to_double(param_2),::Vertx::Util::Utils.to_double(param_3),::Vertx::Util::Utils.to_float(param_4)),::VertxWebApiContract::ParameterTypeValidator)
  elsif (param_1.class == TrueClass || param_1.class == FalseClass) && param_2.class == Float && (param_3.class == TrueClass || param_3.class == FalseClass) && param_4.class == Float && param_5.class == Float && ::Vertx::Util::unknown_type.accept?(param_6) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createFloatTypeValidator, [Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::java.lang.Object.java_class]).call(param_1,::Vertx::Util::Utils.to_double(param_2),param_3,::Vertx::Util::Utils.to_double(param_4),::Vertx::Util::Utils.to_double(param_5),::Vertx::Util::Utils.to_object(param_6)),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_float_type_validator(#{param_1},#{param_2},#{param_3},#{param_4},#{param_5},#{param_6})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) createIntegerTypeValidator(defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createIntegerTypeValidator(maximum, minimum, multipleOf, defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createIntegerTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

Create a new type validator for integer values

Overloads:

  • + (::VertxWebApiContract::ParameterTypeValidator) createIntegerTypeValidator(defaultValue)

    Parameters:

    • defaultValue (Fixnum)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createIntegerTypeValidator(maximum, minimum, multipleOf, defaultValue)

    Parameters:

    • maximum (Float)
      Maximum value. It can be null
    • minimum (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Fixnum)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createIntegerTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

    Parameters:

    • exclusiveMaximum (true, false)
      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 (Float)
      Maximum value. It can be null
    • exclusiveMinimum (true, false)
      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 (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Object)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null

Returns:

Raises:

  • (ArgumentError)


88
89
90
91
92
93
94
95
96
97
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 88

def self.create_integer_type_validator(param_1=nil,param_2=nil,param_3=nil,param_4=nil,param_5=nil,param_6=nil)
  if param_1.class == Fixnum && !block_given? && param_2 == nil && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createIntegerTypeValidator, [Java::JavaLang::Integer.java_class]).call(::Vertx::Util::Utils.to_integer(param_1)),::VertxWebApiContract::ParameterTypeValidator)
  elsif param_1.class == Float && param_2.class == Float && param_3.class == Float && param_4.class == Fixnum && !block_given? && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createIntegerTypeValidator, [Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Integer.java_class]).call(::Vertx::Util::Utils.to_double(param_1),::Vertx::Util::Utils.to_double(param_2),::Vertx::Util::Utils.to_double(param_3),::Vertx::Util::Utils.to_integer(param_4)),::VertxWebApiContract::ParameterTypeValidator)
  elsif (param_1.class == TrueClass || param_1.class == FalseClass) && param_2.class == Float && (param_3.class == TrueClass || param_3.class == FalseClass) && param_4.class == Float && param_5.class == Float && ::Vertx::Util::unknown_type.accept?(param_6) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createIntegerTypeValidator, [Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::java.lang.Object.java_class]).call(param_1,::Vertx::Util::Utils.to_double(param_2),param_3,::Vertx::Util::Utils.to_double(param_4),::Vertx::Util::Utils.to_double(param_5),::Vertx::Util::Utils.to_object(param_6)),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_integer_type_validator(#{param_1},#{param_2},#{param_3},#{param_4},#{param_5},#{param_6})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) createLongTypeValidator(defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createLongTypeValidator(maximum, minimum, multipleOf, defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createLongTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

Create a new type validator for long integer values

Overloads:

  • + (::VertxWebApiContract::ParameterTypeValidator) createLongTypeValidator(defaultValue)

    Parameters:

    • defaultValue (Fixnum)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createLongTypeValidator(maximum, minimum, multipleOf, defaultValue)

    Parameters:

    • maximum (Float)
      Maximum value. It can be null
    • minimum (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Fixnum)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createLongTypeValidator(exclusiveMaximum, maximum, exclusiveMinimum, minimum, multipleOf, defaultValue)

    Parameters:

    • exclusiveMaximum (true, false)
      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 (Float)
      Maximum value. It can be null
    • exclusiveMinimum (true, false)
      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 (Float)
      Minimum value. It can be null
    • multipleOf (Float)
      Multiple of value. It can be null
    • defaultValue (Object)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null

Returns:

Raises:

  • (ArgumentError)


114
115
116
117
118
119
120
121
122
123
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 114

def self.create_long_type_validator(param_1=nil,param_2=nil,param_3=nil,param_4=nil,param_5=nil,param_6=nil)
  if param_1.class == Fixnum && !block_given? && param_2 == nil && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createLongTypeValidator, [Java::JavaLang::Long.java_class]).call(param_1),::VertxWebApiContract::ParameterTypeValidator)
  elsif param_1.class == Float && param_2.class == Float && param_3.class == Float && param_4.class == Fixnum && !block_given? && param_5 == nil && param_6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createLongTypeValidator, [Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Long.java_class]).call(::Vertx::Util::Utils.to_double(param_1),::Vertx::Util::Utils.to_double(param_2),::Vertx::Util::Utils.to_double(param_3),param_4),::VertxWebApiContract::ParameterTypeValidator)
  elsif (param_1.class == TrueClass || param_1.class == FalseClass) && param_2.class == Float && (param_3.class == TrueClass || param_3.class == FalseClass) && param_4.class == Float && param_5.class == Float && ::Vertx::Util::unknown_type.accept?(param_6) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createLongTypeValidator, [Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Boolean.java_class,Java::JavaLang::Double.java_class,Java::JavaLang::Double.java_class,Java::java.lang.Object.java_class]).call(param_1,::Vertx::Util::Utils.to_double(param_2),param_3,::Vertx::Util::Utils.to_double(param_4),::Vertx::Util::Utils.to_double(param_5),::Vertx::Util::Utils.to_object(param_6)),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_long_type_validator(#{param_1},#{param_2},#{param_3},#{param_4},#{param_5},#{param_6})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) create_string_enum_type_validator(allowedValues = nil)

Create an enum type validator

Parameters:

  • allowedValues (Array<String>) (defaults to: nil)
    allowed values. It can't be null

Returns:

Raises:

  • (ArgumentError)


210
211
212
213
214
215
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 210

def self.create_string_enum_type_validator(allowedValues=nil)
  if allowedValues.class == Array && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createStringEnumTypeValidator, [Java::JavaUtil::List.java_class]).call(allowedValues.map { |element| element }),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_string_enum_type_validator(#{allowedValues})"
end

+ (::VertxWebApiContract::ParameterTypeValidator) createStringTypeValidator(defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createStringTypeValidator(pattern, defaultValue) + (::VertxWebApiContract::ParameterTypeValidator) createStringTypeValidator(pattern, minLength, maxLength, defaultValue)

Create a new string type validator

Overloads:

  • + (::VertxWebApiContract::ParameterTypeValidator) createStringTypeValidator(defaultValue)

    Parameters:

    • defaultValue (Object)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createStringTypeValidator(pattern, defaultValue)

    Parameters:

    • pattern (String)
      pattern that string have to match. It can be null
    • defaultValue (Object)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null
  • + (::VertxWebApiContract::ParameterTypeValidator) createStringTypeValidator(pattern, minLength, maxLength, defaultValue)

    Parameters:

    • pattern (String)
      pattern that string have to match. It can be null
    • minLength (Fixnum)
      Minimum length of string. It can be null
    • maxLength (Fixnum)
      Maximum length of string. It can be null
    • defaultValue (Object)
      Default value that will be set if parameter is empty or not found. To apply default value you have to set VertxWebApiContract::ParameterValidationRule#allow_empty_value true. It can be null

Returns:

Raises:

  • (ArgumentError)


188
189
190
191
192
193
194
195
196
197
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 188

def self.create_string_type_validator(param_1=nil,param_2=nil,param_3=nil,param_4=nil)
  if ::Vertx::Util::unknown_type.accept?(param_1) && !block_given? && param_2 == nil && param_3 == nil && param_4 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createStringTypeValidator, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(param_1)),::VertxWebApiContract::ParameterTypeValidator)
  elsif param_1.class == String && ::Vertx::Util::unknown_type.accept?(param_2) && !block_given? && param_3 == nil && param_4 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createStringTypeValidator, [Java::java.lang.String.java_class,Java::java.lang.Object.java_class]).call(param_1,::Vertx::Util::Utils.to_object(param_2)),::VertxWebApiContract::ParameterTypeValidator)
  elsif param_1.class == String && param_2.class == Fixnum && param_3.class == Fixnum && ::Vertx::Util::unknown_type.accept?(param_4) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_method(:createStringTypeValidator, [Java::java.lang.String.java_class,Java::JavaLang::Integer.java_class,Java::JavaLang::Integer.java_class,Java::java.lang.Object.java_class]).call(param_1,::Vertx::Util::Utils.to_integer(param_2),::Vertx::Util::Utils.to_integer(param_3),::Vertx::Util::Utils.to_object(param_4)),::VertxWebApiContract::ParameterTypeValidator)
  end
  raise ArgumentError, "Invalid arguments when calling create_string_type_validator(#{param_1},#{param_2},#{param_3},#{param_4})"
end

+ (Object) j_api_type



38
39
40
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 38

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



41
42
43
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 41

def self.j_class
  Java::IoVertxExtWebApiValidation::ParameterTypeValidator.java_class
end

+ (Object) unwrap(obj)



35
36
37
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 35

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



32
33
34
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 32

def @@j_api_type.wrap(obj)
  ParameterTypeValidator.new(obj)
end

Instance Method Details

- (Object) get_default

Returns default value of parameter

Returns:

  • (Object)

Raises:

  • (ArgumentError)


66
67
68
69
70
71
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 66

def get_default
  if !block_given?
    return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getDefault, []).call())
  end
  raise ArgumentError, "Invalid arguments when calling get_default()"
end

- (::VertxWebApiContract::RequestParameter) is_valid(value = nil)

Function that checks if parameter is valid. It returns a RequestParameter object that will be linked inside . For more info, check .

Parameters:

  • value (String) (defaults to: nil)
    value of parameter to test

Returns:

Raises:

  • (ArgumentError)


48
49
50
51
52
53
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 48

def is_valid(value=nil)
  if value.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:isValid, [Java::java.lang.String.java_class]).call(value),::VertxWebApiContract::RequestParameter)
  end
  raise ArgumentError, "Invalid arguments when calling is_valid(#{value})"
end

- (::VertxWebApiContract::RequestParameter) is_valid_collection(value = nil)

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 (Array<String>) (defaults to: nil)
    list of values of parameter to test

Returns:

Raises:

  • (ArgumentError)


58
59
60
61
62
63
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 58

def is_valid_collection(value=nil)
  if value.class == Array && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:isValidCollection, [Java::JavaUtil::List.java_class]).call(value.map { |element| element }),::VertxWebApiContract::RequestParameter)
  end
  raise ArgumentError, "Invalid arguments when calling is_valid_collection(#{value})"
end