Class: VertxWebClient::ResponsePredicate

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb

Overview

A predicate on .

By default, a Vert.x Web Client request ends with an error only if something wrong happens at the network level. In other words, a 404 Not Found response, or a response with the wrong content type, are NOT considered as failures.

predicates can fail a request when the response does not match some criteria.

Custom predicate instances can be used with .

As a convenience, a few predicates for common uses cases are predefined. For example:

  • SC_SUCCESS to verify that the response has a 2xx code, or
  • JSON to verify that the response body contains JSON data.
  • ...
Predefined predicates use the default error converter (discarding the body).

However, you can create a new ResponsePredicate instance from an existing one using #create or #create when the body is required to build the validation failure.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)

38
39
40
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 38

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

+ (::VertxWebClient::ResponsePredicate) contentType(mimeType) + (::VertxWebClient::ResponsePredicate) contentType(mimeTypes)

Creates a predicate validating the response has a content-type header matching one of the mimeTypes.

Overloads:

Returns:

Raises:

  • (ArgumentError)

71
72
73
74
75
76
77
78
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 71

def self.content_type(param_1=nil)
  if param_1.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_method(:contentType, [Java::java.lang.String.java_class]).call(param_1),::VertxWebClient::ResponsePredicate)
  elsif param_1.class == Array && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_method(:contentType, [Java::JavaUtil::List.java_class]).call(param_1.map { |element| element }),::VertxWebClient::ResponsePredicate)
  end
  raise ArgumentError, "Invalid arguments when calling content_type(#{param_1})"
end

+ (::VertxWebClient::ResponsePredicate) create(test = nil, errorConverter = nil)

Creates a new VertxWebClient::ResponsePredicate, using a custom errorConverter.

Parameters:

  • test (Proc) (defaults to: nil)
    the function to invoke when the response is received
  • errorConverter (::VertxWebClient::ErrorConverter) (defaults to: nil)
    converts the result of the test function to a Throwable

Returns:

Raises:

  • (ArgumentError)

83
84
85
86
87
88
89
90
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 83

def self.create(test=nil,errorConverter=nil)
  if block_given? && test == nil && errorConverter == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_method(:create, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWebClient::HttpResponse, nil)).j_del })),::VertxWebClient::ResponsePredicate)
  elsif test.class == Proc && errorConverter.class.method_defined?(:j_del) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_method(:create, [Java::JavaUtilFunction::Function.java_class,Java::IoVertxExtWebClientPredicate::ErrorConverter.java_class]).call((Proc.new { |event| test.call(::Vertx::Util::Utils.safe_create(event,::VertxWebClient::HttpResponse, nil)).j_del }),errorConverter.j_del),::VertxWebClient::ResponsePredicate)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{test},#{errorConverter})"
end

+ (Object) j_api_type


47
48
49
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 47

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class


50
51
52
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 50

def self.j_class
  Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_class
end

+ (Object) JSON

Creates a predicate validating the response content-type is application/json.

347
348
349
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 347

def self.JSON
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.JSON,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_ACCEPTED

202 Accepted

131
132
133
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 131

def self.SC_ACCEPTED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_ACCEPTED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_BAD_GATEWAY

502 Bad Gateway

315
316
317
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 315

def self.SC_BAD_GATEWAY
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_BAD_GATEWAY,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_BAD_REQUEST

400 Bad Request

195
196
197
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 195

def self.SC_BAD_REQUEST
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_BAD_REQUEST,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CLIENT_ERRORS

Any 4XX client error

191
192
193
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 191

def self.SC_CLIENT_ERRORS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CLIENT_ERRORS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CONFLICT

409 Conflict

231
232
233
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 231

def self.SC_CONFLICT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CONFLICT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CONTINUE

100 Continue

103
104
105
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 103

def self.SC_CONTINUE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CONTINUE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CREATED

201 Created

127
128
129
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 127

def self.SC_CREATED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CREATED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_EARLY_HINTS

103 Early Hints

115
116
117
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 115

def self.SC_EARLY_HINTS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_EARLY_HINTS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_EXPECTATION_FAILED

417 Expectation Failed

263
264
265
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 263

def self.SC_EXPECTATION_FAILED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_EXPECTATION_FAILED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_FAILED_DEPENDENCY

424 Failed Dependency (WebDAV, RFC4918)

279
280
281
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 279

def self.SC_FAILED_DEPENDENCY
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_FAILED_DEPENDENCY,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_FORBIDDEN

403 Forbidden

207
208
209
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 207

def self.SC_FORBIDDEN
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_FORBIDDEN,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_FOUND

302 Found

167
168
169
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 167

def self.SC_FOUND
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_FOUND,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_GATEWAY_TIMEOUT

504 Gateway Timeout

323
324
325
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 323

def self.SC_GATEWAY_TIMEOUT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_GATEWAY_TIMEOUT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_GONE

410 Gone

235
236
237
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 235

def self.SC_GONE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_GONE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_HTTP_VERSION_NOT_SUPPORTED

505 HTTP Version Not Supported

327
328
329
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 327

def self.SC_HTTP_VERSION_NOT_SUPPORTED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_HTTP_VERSION_NOT_SUPPORTED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_INFORMATIONAL_RESPONSE

Any 1XX informational response

99
100
101
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 99

def self.SC_INFORMATIONAL_RESPONSE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_INFORMATIONAL_RESPONSE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_INSUFFICIENT_STORAGE

507 Insufficient Storage (WebDAV, RFC4918)

335
336
337
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 335

def self.SC_INSUFFICIENT_STORAGE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_INSUFFICIENT_STORAGE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_INTERNAL_SERVER_ERROR

500 Internal Server Error

307
308
309
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 307

def self.SC_INTERNAL_SERVER_ERROR
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_INTERNAL_SERVER_ERROR,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_LENGTH_REQUIRED

411 Length Required

239
240
241
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 239

def self.SC_LENGTH_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_LENGTH_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_LOCKED

423 Locked (WebDAV, RFC4918)

275
276
277
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 275

def self.SC_LOCKED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_LOCKED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_METHOD_NOT_ALLOWED

405 Method Not Allowed

215
216
217
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 215

def self.SC_METHOD_NOT_ALLOWED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_METHOD_NOT_ALLOWED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_MISDIRECTED_REQUEST

421 Misdirected Request

267
268
269
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 267

def self.SC_MISDIRECTED_REQUEST
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_MISDIRECTED_REQUEST,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_MOVED_PERMANENTLY

301 Moved Permanently

163
164
165
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 163

def self.SC_MOVED_PERMANENTLY
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_MOVED_PERMANENTLY,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_MULTI_STATUS

207 Multi-Status (WebDAV, RFC2518)

151
152
153
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 151

def self.SC_MULTI_STATUS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_MULTI_STATUS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_MULTIPLE_CHOICES

300 Multiple Choices

159
160
161
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 159

def self.SC_MULTIPLE_CHOICES
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_MULTIPLE_CHOICES,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NETWORK_AUTHENTICATION_REQUIRED

511 Network Authentication Required (RFC6585)

343
344
345
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 343

def self.SC_NETWORK_AUTHENTICATION_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NETWORK_AUTHENTICATION_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NO_CONTENT

204 No Content

139
140
141
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 139

def self.SC_NO_CONTENT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NO_CONTENT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NON_AUTHORITATIVE_INFORMATION

203 Non-Authoritative Information (since HTTP/1.1)

135
136
137
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 135

def self.SC_NON_AUTHORITATIVE_INFORMATION
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NON_AUTHORITATIVE_INFORMATION,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_ACCEPTABLE

406 Not Acceptable

219
220
221
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 219

def self.SC_NOT_ACCEPTABLE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_ACCEPTABLE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_EXTENDED

510 Not Extended (RFC2774)

339
340
341
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 339

def self.SC_NOT_EXTENDED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_EXTENDED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_FOUND

404 Not Found

211
212
213
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 211

def self.SC_NOT_FOUND
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_FOUND,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_IMPLEMENTED

501 Not Implemented

311
312
313
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 311

def self.SC_NOT_IMPLEMENTED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_IMPLEMENTED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_MODIFIED

304 Not Modified

175
176
177
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 175

def self.SC_NOT_MODIFIED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_MODIFIED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_OK

200 OK

123
124
125
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 123

def self.SC_OK
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_OK,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PARTIAL_CONTENT

206 Partial Content

147
148
149
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 147

def self.SC_PARTIAL_CONTENT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PARTIAL_CONTENT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PAYMENT_REQUIRED

402 Payment Required

203
204
205
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 203

def self.SC_PAYMENT_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PAYMENT_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PERMANENT_REDIRECT

308 Permanent Redirect (RFC7538)

187
188
189
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 187

def self.SC_PERMANENT_REDIRECT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PERMANENT_REDIRECT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PRECONDITION_FAILED

412 Precondition Failed

243
244
245
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 243

def self.SC_PRECONDITION_FAILED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PRECONDITION_FAILED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PRECONDITION_REQUIRED

428 Precondition Required (RFC6585)

291
292
293
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 291

def self.SC_PRECONDITION_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PRECONDITION_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PROCESSING

102 Processing (WebDAV, RFC2518)

111
112
113
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 111

def self.SC_PROCESSING
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PROCESSING,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PROXY_AUTHENTICATION_REQUIRED

407 Proxy Authentication Required

223
224
225
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 223

def self.SC_PROXY_AUTHENTICATION_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PROXY_AUTHENTICATION_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_REDIRECTION

Any 3XX redirection

155
156
157
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 155

def self.SC_REDIRECTION
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_REDIRECTION,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_REQUEST_ENTITY_TOO_LARGE

413 Request Entity Too Large

247
248
249
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 247

def self.SC_REQUEST_ENTITY_TOO_LARGE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_REQUEST_ENTITY_TOO_LARGE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_REQUEST_HEADER_FIELDS_TOO_LARGE

431 Request Header Fields Too Large (RFC6585)

299
300
301
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 299

def self.SC_REQUEST_HEADER_FIELDS_TOO_LARGE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_REQUEST_HEADER_FIELDS_TOO_LARGE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_REQUEST_TIMEOUT

408 Request Timeout

227
228
229
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 227

def self.SC_REQUEST_TIMEOUT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_REQUEST_TIMEOUT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_REQUEST_URI_TOO_LONG

414 Request-URI Too Long

251
252
253
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 251

def self.SC_REQUEST_URI_TOO_LONG
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_REQUEST_URI_TOO_LONG,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_REQUESTED_RANGE_NOT_SATISFIABLE

416 Requested Range Not Satisfiable

259
260
261
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 259

def self.SC_REQUESTED_RANGE_NOT_SATISFIABLE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_REQUESTED_RANGE_NOT_SATISFIABLE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_RESET_CONTENT

205 Reset Content

143
144
145
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 143

def self.SC_RESET_CONTENT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_RESET_CONTENT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SEE_OTHER

303 See Other (since HTTP/1.1)

171
172
173
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 171

def self.SC_SEE_OTHER
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SEE_OTHER,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SERVER_ERRORS

Any 5XX server error

303
304
305
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 303

def self.SC_SERVER_ERRORS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SERVER_ERRORS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SERVICE_UNAVAILABLE

503 Service Unavailable

319
320
321
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 319

def self.SC_SERVICE_UNAVAILABLE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SERVICE_UNAVAILABLE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SUCCESS

Any 2XX success

119
120
121
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 119

def self.SC_SUCCESS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SUCCESS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SWITCHING_PROTOCOLS

101 Switching Protocols

107
108
109
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 107

def self.SC_SWITCHING_PROTOCOLS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SWITCHING_PROTOCOLS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_TEMPORARY_REDIRECT

307 Temporary Redirect (since HTTP/1.1)

183
184
185
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 183

def self.SC_TEMPORARY_REDIRECT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_TEMPORARY_REDIRECT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_TOO_MANY_REQUESTS

429 Too Many Requests (RFC6585)

295
296
297
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 295

def self.SC_TOO_MANY_REQUESTS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_TOO_MANY_REQUESTS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_UNAUTHORIZED

401 Unauthorized

199
200
201
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 199

def self.SC_UNAUTHORIZED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_UNAUTHORIZED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_UNORDERED_COLLECTION

425 Unordered Collection (WebDAV, RFC3648)

283
284
285
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 283

def self.SC_UNORDERED_COLLECTION
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_UNORDERED_COLLECTION,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_UNPROCESSABLE_ENTITY

422 Unprocessable Entity (WebDAV, RFC4918)

271
272
273
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 271

def self.SC_UNPROCESSABLE_ENTITY
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_UNPROCESSABLE_ENTITY,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_UNSUPPORTED_MEDIA_TYPE

415 Unsupported Media Type

255
256
257
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 255

def self.SC_UNSUPPORTED_MEDIA_TYPE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_UNSUPPORTED_MEDIA_TYPE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_UPGRADE_REQUIRED

426 Upgrade Required (RFC2817)

287
288
289
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 287

def self.SC_UPGRADE_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_UPGRADE_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_USE_PROXY

305 Use Proxy (since HTTP/1.1)

179
180
181
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 179

def self.SC_USE_PROXY
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_USE_PROXY,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_VARIANT_ALSO_NEGOTIATES

506 Variant Also Negotiates (RFC2295)

331
332
333
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 331

def self.SC_VARIANT_ALSO_NEGOTIATES
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_VARIANT_ALSO_NEGOTIATES,::VertxWebClient::ResponsePredicate)
end

+ (::VertxWebClient::ResponsePredicate) status(min = nil, max = nil)

Creates a predicate asserting that the status response code is in the [min,max[ range.

Parameters:

  • min (Fixnum) (defaults to: nil)
    the lower (inclusive) accepted status code
  • max (Fixnum) (defaults to: nil)
    the highest (exclusive) accepted status code

Returns:

Raises:

  • (ArgumentError)

57
58
59
60
61
62
63
64
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 57

def self.status(min=nil,max=nil)
  if min.class == Fixnum && !block_given? && max == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_method(:status, [Java::int.java_class]).call(min),::VertxWebClient::ResponsePredicate)
  elsif min.class == Fixnum && max.class == Fixnum && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_method(:status, [Java::int.java_class,Java::int.java_class]).call(min,max),::VertxWebClient::ResponsePredicate)
  end
  raise ArgumentError, "Invalid arguments when calling status(#{min},#{max})"
end

+ (Object) unwrap(obj)


44
45
46
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 44

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

+ (Object) wrap(obj)


41
42
43
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 41

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

Instance Method Details

- (::VertxWebClient::ErrorConverter) error_converter

Returns the error converter currently used

Returns:

Raises:

  • (ArgumentError)

92
93
94
95
96
97
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 92

def error_converter
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:errorConverter, []).call(),::VertxWebClient::ErrorConverter)
  end
  raise ArgumentError, "Invalid arguments when calling error_converter()"
end