public class ResponsePredicate extends Object implements java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult>
 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.
 
 Response 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:
ResponsePredicate to verify that the response has a 2xx code, orResponsePredicate to verify that the response body contains JSON data.
 However, you can create a new ResponsePredicate instance from an existing one using create(java.util.function.Function<io.vertx.rxjava.ext.web.client.HttpResponse<java.lang.Void>, io.vertx.rxjava.ext.web.client.predicate.ResponsePredicateResult>) or
 create(java.util.function.Function<io.vertx.rxjava.ext.web.client.HttpResponse<java.lang.Void>, io.vertx.rxjava.ext.web.client.predicate.ResponsePredicateResult>) when the body is required to build the validation failure.
 
original non RX-ified interface using Vert.x codegen.| Modifier and Type | Field and Description | 
|---|---|
| static io.vertx.lang.rx.TypeArg<ResponsePredicate> | __TYPE_ARG | 
| static ResponsePredicate | JSONCreates a predicate validating the response  content-typeisapplication/json. | 
| static ResponsePredicate | SC_ACCEPTED202 Accepted | 
| static ResponsePredicate | SC_BAD_GATEWAY502 Bad Gateway | 
| static ResponsePredicate | SC_BAD_REQUEST400 Bad Request | 
| static ResponsePredicate | SC_CLIENT_ERRORSAny 4XX client error | 
| static ResponsePredicate | SC_CONFLICT409 Conflict | 
| static ResponsePredicate | SC_CONTINUE100 Continue | 
| static ResponsePredicate | SC_CREATED201 Created | 
| static ResponsePredicate | SC_EARLY_HINTS103 Early Hints | 
| static ResponsePredicate | SC_EXPECTATION_FAILED417 Expectation Failed | 
| static ResponsePredicate | SC_FAILED_DEPENDENCY424 Failed Dependency (WebDAV, RFC4918) | 
| static ResponsePredicate | SC_FORBIDDEN403 Forbidden | 
| static ResponsePredicate | SC_FOUND302 Found | 
| static ResponsePredicate | SC_GATEWAY_TIMEOUT504 Gateway Timeout | 
| static ResponsePredicate | SC_GONE410 Gone | 
| static ResponsePredicate | SC_HTTP_VERSION_NOT_SUPPORTED505 HTTP Version Not Supported | 
| static ResponsePredicate | SC_INFORMATIONAL_RESPONSEAny 1XX informational response | 
| static ResponsePredicate | SC_INSUFFICIENT_STORAGE507 Insufficient Storage (WebDAV, RFC4918) | 
| static ResponsePredicate | SC_INTERNAL_SERVER_ERROR500 Internal Server Error | 
| static ResponsePredicate | SC_LENGTH_REQUIRED411 Length Required | 
| static ResponsePredicate | SC_LOCKED423 Locked (WebDAV, RFC4918) | 
| static ResponsePredicate | SC_METHOD_NOT_ALLOWED405 Method Not Allowed | 
| static ResponsePredicate | SC_MISDIRECTED_REQUEST421 Misdirected Request | 
| static ResponsePredicate | SC_MOVED_PERMANENTLY301 Moved Permanently | 
| static ResponsePredicate | SC_MULTI_STATUS207 Multi-Status (WebDAV, RFC2518) | 
| static ResponsePredicate | SC_MULTIPLE_CHOICES300 Multiple Choices | 
| static ResponsePredicate | SC_NETWORK_AUTHENTICATION_REQUIRED511 Network Authentication Required (RFC6585) | 
| static ResponsePredicate | SC_NO_CONTENT204 No Content | 
| static ResponsePredicate | SC_NON_AUTHORITATIVE_INFORMATION203 Non-Authoritative Information (since HTTP/1.1) | 
| static ResponsePredicate | SC_NOT_ACCEPTABLE406 Not Acceptable | 
| static ResponsePredicate | SC_NOT_EXTENDED510 Not Extended (RFC2774) | 
| static ResponsePredicate | SC_NOT_FOUND404 Not Found | 
| static ResponsePredicate | SC_NOT_IMPLEMENTED501 Not Implemented | 
| static ResponsePredicate | SC_NOT_MODIFIED304 Not Modified | 
| static ResponsePredicate | SC_OK200 OK | 
| static ResponsePredicate | SC_PARTIAL_CONTENT206 Partial Content | 
| static ResponsePredicate | SC_PAYMENT_REQUIRED402 Payment Required | 
| static ResponsePredicate | SC_PERMANENT_REDIRECT308 Permanent Redirect (RFC7538) | 
| static ResponsePredicate | SC_PRECONDITION_FAILED412 Precondition Failed | 
| static ResponsePredicate | SC_PRECONDITION_REQUIRED428 Precondition Required (RFC6585) | 
| static ResponsePredicate | SC_PROCESSING102 Processing (WebDAV, RFC2518) | 
| static ResponsePredicate | SC_PROXY_AUTHENTICATION_REQUIRED407 Proxy Authentication Required | 
| static ResponsePredicate | SC_REDIRECTIONAny 3XX redirection | 
| static ResponsePredicate | SC_REQUEST_ENTITY_TOO_LARGE413 Request Entity Too Large | 
| static ResponsePredicate | SC_REQUEST_HEADER_FIELDS_TOO_LARGE431 Request Header Fields Too Large (RFC6585) | 
| static ResponsePredicate | SC_REQUEST_TIMEOUT408 Request Timeout | 
| static ResponsePredicate | SC_REQUEST_URI_TOO_LONG414 Request-URI Too Long | 
| static ResponsePredicate | SC_REQUESTED_RANGE_NOT_SATISFIABLE416 Requested Range Not Satisfiable | 
| static ResponsePredicate | SC_RESET_CONTENT205 Reset Content | 
| static ResponsePredicate | SC_SEE_OTHER303 See Other (since HTTP/1.1) | 
| static ResponsePredicate | SC_SERVER_ERRORSAny 5XX server error | 
| static ResponsePredicate | SC_SERVICE_UNAVAILABLE503 Service Unavailable | 
| static ResponsePredicate | SC_SUCCESSAny 2XX success | 
| static ResponsePredicate | SC_SWITCHING_PROTOCOLS101 Switching Protocols | 
| static ResponsePredicate | SC_TEMPORARY_REDIRECT307 Temporary Redirect (since HTTP/1.1) | 
| static ResponsePredicate | SC_TOO_MANY_REQUESTS429 Too Many Requests (RFC6585) | 
| static ResponsePredicate | SC_UNAUTHORIZED401 Unauthorized | 
| static ResponsePredicate | SC_UNORDERED_COLLECTION425 Unordered Collection (WebDAV, RFC3648) | 
| static ResponsePredicate | SC_UNPROCESSABLE_ENTITY422 Unprocessable Entity (WebDAV, RFC4918) | 
| static ResponsePredicate | SC_UNSUPPORTED_MEDIA_TYPE415 Unsupported Media Type | 
| static ResponsePredicate | SC_UPGRADE_REQUIRED426 Upgrade Required (RFC2817) | 
| static ResponsePredicate | SC_USE_PROXY305 Use Proxy (since HTTP/1.1) | 
| static ResponsePredicate | SC_VARIANT_ALSO_NEGOTIATES506 Variant Also Negotiates (RFC2295) | 
| Constructor and Description | 
|---|
| ResponsePredicate(Object delegate) | 
| ResponsePredicate(ResponsePredicate delegate) | 
| Modifier and Type | Method and Description | 
|---|---|
| ResponsePredicateResult | apply(HttpResponse<Void> in) | 
| static ResponsePredicate | contentType(List<String> mimeTypes)Creates a predicate validating the response has a  content-typeheader matching one of themimeTypes. | 
| static ResponsePredicate | contentType(String mimeType)Creates a predicate validating the response has a  content-typeheader matching themimeType. | 
| static ResponsePredicate | create(java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult> test)Creates a new  ResponsePredicate. | 
| static ResponsePredicate | create(java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult> test,
      ErrorConverter errorConverter)Creates a new  ResponsePredicate, using a customerrorConverter. | 
| boolean | equals(Object o) | 
| ErrorConverter | errorConverter() | 
| ResponsePredicate | getDelegate() | 
| int | hashCode() | 
| static ResponsePredicate | newInstance(ResponsePredicate arg) | 
| static ResponsePredicate | status(int statusCode)Creates a predicate asserting that the status response code is equal to  statusCode. | 
| static ResponsePredicate | status(int min,
      int max)Creates a predicate asserting that the status response code is in the  [min,max[range. | 
| String | toString() | 
clone, finalize, getClass, notify, notifyAll, wait, wait, waitandThen, compose, identitypublic static final io.vertx.lang.rx.TypeArg<ResponsePredicate> __TYPE_ARG
public static final ResponsePredicate SC_INFORMATIONAL_RESPONSE
public static final ResponsePredicate SC_CONTINUE
public static final ResponsePredicate SC_SWITCHING_PROTOCOLS
public static final ResponsePredicate SC_PROCESSING
public static final ResponsePredicate SC_EARLY_HINTS
public static final ResponsePredicate SC_SUCCESS
public static final ResponsePredicate SC_OK
public static final ResponsePredicate SC_CREATED
public static final ResponsePredicate SC_ACCEPTED
public static final ResponsePredicate SC_NON_AUTHORITATIVE_INFORMATION
public static final ResponsePredicate SC_NO_CONTENT
public static final ResponsePredicate SC_RESET_CONTENT
public static final ResponsePredicate SC_PARTIAL_CONTENT
public static final ResponsePredicate SC_MULTI_STATUS
public static final ResponsePredicate SC_REDIRECTION
public static final ResponsePredicate SC_MULTIPLE_CHOICES
public static final ResponsePredicate SC_MOVED_PERMANENTLY
public static final ResponsePredicate SC_FOUND
public static final ResponsePredicate SC_SEE_OTHER
public static final ResponsePredicate SC_NOT_MODIFIED
public static final ResponsePredicate SC_USE_PROXY
public static final ResponsePredicate SC_TEMPORARY_REDIRECT
public static final ResponsePredicate SC_PERMANENT_REDIRECT
public static final ResponsePredicate SC_CLIENT_ERRORS
public static final ResponsePredicate SC_BAD_REQUEST
public static final ResponsePredicate SC_UNAUTHORIZED
public static final ResponsePredicate SC_PAYMENT_REQUIRED
public static final ResponsePredicate SC_FORBIDDEN
public static final ResponsePredicate SC_NOT_FOUND
public static final ResponsePredicate SC_METHOD_NOT_ALLOWED
public static final ResponsePredicate SC_NOT_ACCEPTABLE
public static final ResponsePredicate SC_PROXY_AUTHENTICATION_REQUIRED
public static final ResponsePredicate SC_REQUEST_TIMEOUT
public static final ResponsePredicate SC_CONFLICT
public static final ResponsePredicate SC_GONE
public static final ResponsePredicate SC_LENGTH_REQUIRED
public static final ResponsePredicate SC_PRECONDITION_FAILED
public static final ResponsePredicate SC_REQUEST_ENTITY_TOO_LARGE
public static final ResponsePredicate SC_REQUEST_URI_TOO_LONG
public static final ResponsePredicate SC_UNSUPPORTED_MEDIA_TYPE
public static final ResponsePredicate SC_REQUESTED_RANGE_NOT_SATISFIABLE
public static final ResponsePredicate SC_EXPECTATION_FAILED
public static final ResponsePredicate SC_MISDIRECTED_REQUEST
public static final ResponsePredicate SC_UNPROCESSABLE_ENTITY
public static final ResponsePredicate SC_LOCKED
public static final ResponsePredicate SC_FAILED_DEPENDENCY
public static final ResponsePredicate SC_UNORDERED_COLLECTION
public static final ResponsePredicate SC_UPGRADE_REQUIRED
public static final ResponsePredicate SC_PRECONDITION_REQUIRED
public static final ResponsePredicate SC_TOO_MANY_REQUESTS
public static final ResponsePredicate SC_REQUEST_HEADER_FIELDS_TOO_LARGE
public static final ResponsePredicate SC_SERVER_ERRORS
public static final ResponsePredicate SC_INTERNAL_SERVER_ERROR
public static final ResponsePredicate SC_NOT_IMPLEMENTED
public static final ResponsePredicate SC_BAD_GATEWAY
public static final ResponsePredicate SC_SERVICE_UNAVAILABLE
public static final ResponsePredicate SC_GATEWAY_TIMEOUT
public static final ResponsePredicate SC_HTTP_VERSION_NOT_SUPPORTED
public static final ResponsePredicate SC_VARIANT_ALSO_NEGOTIATES
public static final ResponsePredicate SC_INSUFFICIENT_STORAGE
public static final ResponsePredicate SC_NOT_EXTENDED
public static final ResponsePredicate SC_NETWORK_AUTHENTICATION_REQUIRED
public static final ResponsePredicate JSON
content-type is application/json.public ResponsePredicate(ResponsePredicate delegate)
public ResponsePredicate(Object delegate)
public ResponsePredicateResult apply(HttpResponse<Void> in)
apply in interface java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult>public ResponsePredicate getDelegate()
public static ResponsePredicate status(int statusCode)
statusCode.statusCode - the expected status codepublic static ResponsePredicate status(int min, int max)
[min,max[ range.min - the lower (inclusive) accepted status codemax - the highest (exclusive) accepted status codepublic static ResponsePredicate contentType(String mimeType)
content-type header matching the mimeType.mimeType - the mime typepublic static ResponsePredicate contentType(List<String> mimeTypes)
content-type header matching one of the mimeTypes.mimeTypes - the list of mime typespublic static ResponsePredicate create(java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult> test)
ResponsePredicate. The default error converter will be used (discarding the body).test - the function to invoke when the response is receivedpublic static ResponsePredicate create(java.util.function.Function<HttpResponse<Void>,ResponsePredicateResult> test, ErrorConverter errorConverter)
ResponsePredicate, using a custom errorConverter.test - the function to invoke when the response is receivederrorConverter - converts the result of the test function to a Throwablepublic ErrorConverter errorConverter()
public static ResponsePredicate newInstance(ResponsePredicate arg)
Copyright © 2023 Eclipse. All rights reserved.