Class: VertxWebApiContract::ParameterTypeValidator
- Inherits:
-
Object
- Object
- VertxWebApiContract::ParameterTypeValidator
- 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 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)
- + (Boolean) accept?(obj)
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_array_type_validator(arrayMembersValidator = nil, collectionFormat = nil, maxItems = nil, minItems = nil)
Create an array type validator.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_boolean_type_validator(defaultValue = nil)
Create a boolean type validator.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_double_type_validator(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil, param_5 = nil, param_6 = nil)
Create a new type validator for double values.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_enum_type_validator_with_inner_validator(allowedValues = nil, innerValidator = nil)
Create an enum type validator.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_float_type_validator(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil, param_5 = nil, param_6 = nil)
Create a new type validator for float values.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_integer_type_validator(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil, param_5 = nil, param_6 = nil)
Create a new type validator for integer values.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_long_type_validator(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil, param_5 = nil, param_6 = nil)
Create a new type validator for long integer values.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_string_enum_type_validator(allowedValues = nil)
Create an enum type validator.
-
+ (::VertxWebApiContract::ParameterTypeValidator) create_string_type_validator(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil)
Create a new string type validator.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (Object) get_default
Returns default value of parameter.
-
- (true, false) has_default?
Returns true if this type validator has default value.
-
- (::VertxWebApiContract::RequestParameter) is_valid(value = nil)
Function that checks if parameter is valid.
-
- (::VertxWebApiContract::RequestParameter) is_valid_collection(value = nil)
Function that checks if array of values of a specific parameter.
Class Method Details
+ (Boolean) accept?(obj)
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
240 241 242 243 244 245 246 247 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 240 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
209 210 211 212 213 214 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 209 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
174 175 176 177 178 179 180 181 182 183 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 174 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
228 229 230 231 232 233 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 228 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
148 149 150 151 152 153 154 155 156 157 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 148 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
96 97 98 99 100 101 102 103 104 105 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 96 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
122 123 124 125 126 127 128 129 130 131 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 122 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
218 219 220 221 222 223 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 218 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
196 197 198 199 200 201 202 203 204 205 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 196 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
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 |
- (true, false) has_default?
Returns true if this type validator has default value
74 75 76 77 78 79 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-api-contract/parameter_type_validator.rb', line 74 def has_default? if !block_given? return @j_del.java_method(:hasDefault, []).call() end raise ArgumentError, "Invalid arguments when calling has_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 .
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 .
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 |