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)


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

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:



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

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

+ (::VertxWebClient::ResponsePredicate) create(test) { ... } + (::VertxWebClient::ResponsePredicate) create(test, errorConverter)

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

Overloads:

Returns:



73
74
75
76
77
78
79
80
81
82
83
84
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 73

def self.create(*args)
  if block_given? && args[0] == nil && args[1] == 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 unless !block_given? })),::VertxWebClient::ResponsePredicate)
  elsif args[0].class == Proc && args[1].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| args[0].call(::Vertx::Util::Utils.safe_create(event,::VertxWebClient::HttpResponse, nil)).j_del unless args[0] == nil }),args[1].j_del),::VertxWebClient::ResponsePredicate)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create(#{args[0]},#{args[1]})"
  end
end

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) JSON

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


371
372
373
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 371

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

+ (Object) SC_ACCEPTED

202 Accepted


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_ACCEPTED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_ACCEPTED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_BAD_GATEWAY

502 Bad Gateway


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_BAD_GATEWAY
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_BAD_GATEWAY,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_BAD_REQUEST

400 Bad Request


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_BAD_REQUEST
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_BAD_REQUEST,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CLIENT_ERRORS

Any 4XX client error


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_CLIENT_ERRORS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CLIENT_ERRORS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CONFLICT

409 Conflict


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_CONFLICT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CONFLICT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CONTINUE

100 Continue


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_CONTINUE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CONTINUE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_CREATED

201 Created


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_CREATED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_CREATED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_EARLY_HINTS

103 Early Hints


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_EARLY_HINTS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_EARLY_HINTS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_EXPECTATION_FAILED

417 Expectation Failed


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_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)


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_FAILED_DEPENDENCY
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_FAILED_DEPENDENCY,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_FORBIDDEN

403 Forbidden


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_FORBIDDEN
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_FORBIDDEN,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_FOUND

302 Found


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_FOUND
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_FOUND,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_GATEWAY_TIMEOUT

504 Gateway Timeout


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.SC_GATEWAY_TIMEOUT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_GATEWAY_TIMEOUT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_GONE

410 Gone


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_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


351
352
353
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 351

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


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_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)


359
360
361
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 359

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


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_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


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_LENGTH_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_LENGTH_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_LOCKED

423 Locked (WebDAV, RFC4918)


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_LOCKED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_LOCKED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_METHOD_NOT_ALLOWED

405 Method Not Allowed


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_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


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_MISDIRECTED_REQUEST
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_MISDIRECTED_REQUEST,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_MOVED_PERMANENTLY

301 Moved Permanently


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_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)


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_MULTI_STATUS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_MULTI_STATUS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_MULTIPLE_CHOICES

300 Multiple Choices


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_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)


367
368
369
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 367

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


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_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)


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_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


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_NOT_ACCEPTABLE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_ACCEPTABLE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_EXTENDED

510 Not Extended (RFC2774)


363
364
365
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 363

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


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_NOT_FOUND
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_FOUND,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_IMPLEMENTED

501 Not Implemented


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_NOT_IMPLEMENTED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_IMPLEMENTED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_NOT_MODIFIED

304 Not Modified


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_NOT_MODIFIED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_NOT_MODIFIED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_OK

200 OK


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_OK
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_OK,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PARTIAL_CONTENT

206 Partial Content


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_PARTIAL_CONTENT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PARTIAL_CONTENT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PAYMENT_REQUIRED

402 Payment Required


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_PAYMENT_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PAYMENT_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PERMANENT_REDIRECT

308 Permanent Redirect (RFC7538)


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_PERMANENT_REDIRECT
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PERMANENT_REDIRECT,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PRECONDITION_FAILED

412 Precondition Failed


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_PRECONDITION_FAILED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PRECONDITION_FAILED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PRECONDITION_REQUIRED

428 Precondition Required (RFC6585)


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_PRECONDITION_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PRECONDITION_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PROCESSING

102 Processing (WebDAV, RFC2518)


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_PROCESSING
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PROCESSING,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_PROXY_AUTHENTICATION_REQUIRED

407 Proxy Authentication Required


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_PROXY_AUTHENTICATION_REQUIRED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_PROXY_AUTHENTICATION_REQUIRED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_REDIRECTION

Any 3XX redirection


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_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


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_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)


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_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


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_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


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_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


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_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


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_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)


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_SEE_OTHER
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SEE_OTHER,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SERVER_ERRORS

Any 5XX server error


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_SERVER_ERRORS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SERVER_ERRORS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SERVICE_UNAVAILABLE

503 Service Unavailable


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_SERVICE_UNAVAILABLE
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SERVICE_UNAVAILABLE,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SUCCESS

Any 2XX success


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_SUCCESS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_SUCCESS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_SWITCHING_PROTOCOLS

101 Switching Protocols


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_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)


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_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)


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_TOO_MANY_REQUESTS
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_TOO_MANY_REQUESTS,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_UNAUTHORIZED

401 Unauthorized


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_UNAUTHORIZED
  ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.SC_UNAUTHORIZED,::VertxWebClient::ResponsePredicate)
end

+ (Object) SC_UNORDERED_COLLECTION

425 Unordered Collection (WebDAV, RFC3648)


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_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)


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_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


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_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)


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_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)


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_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)


355
356
357
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate.rb', line 355

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

+ (::VertxWebClient::ResponsePredicate) status(statusCode) + (::VertxWebClient::ResponsePredicate) status(min, max)

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

Overloads:

Returns:



110
111
112
113
114
115
116
117
118
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 110

def self.status(*args)
  if args[0].class == Fixnum && !block_given? && args[1] == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_method(:status, [Java::int.java_class]).call(args[0]),::VertxWebClient::ResponsePredicate)
  elsif args[0].class == Fixnum && args[1].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(args[0],args[1]),::VertxWebClient::ResponsePredicate)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling status(#{args[0]},#{args[1]})"
  end
end

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (::VertxWebClient::ErrorConverter) errorConverter

Returns the error converter currently used

Returns:



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

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