Class ResponsePredicate
- java.lang.Object
-
- io.vertx.reactivex.ext.web.client.predicate.ResponsePredicate
-
- All Implemented Interfaces:
RxDelegate,Function<HttpResponse<Void>,ResponsePredicateResult>
@Deprecated public class ResponsePredicate extends Object implements RxDelegate, Function<HttpResponse<Void>,ResponsePredicateResult>
Deprecated.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 Foundresponse, or a response with the wrong content type, are NOT considered as failures.Response predicatescan 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:
ResponsePredicateto verify that the response has a2xxcode, orResponsePredicateto verify that the response body contains JSON data.- ...
However, you can create a new
NOTE: This class has been automatically generated from theResponsePredicateinstance from an existing one usingcreate(java.util.function.Function<io.vertx.reactivex.ext.web.client.HttpResponse<java.lang.Void>, io.vertx.reactivex.ext.web.client.predicate.ResponsePredicateResult>)orcreate(java.util.function.Function<io.vertx.reactivex.ext.web.client.HttpResponse<java.lang.Void>, io.vertx.reactivex.ext.web.client.predicate.ResponsePredicateResult>)when the body is required to build the validation failure.originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<ResponsePredicate>__TYPE_ARGDeprecated.static ResponsePredicateJSONDeprecated.Creates a predicate validating the responsecontent-typeisapplication/json.static ResponsePredicateSC_ACCEPTEDDeprecated.202 Acceptedstatic ResponsePredicateSC_BAD_GATEWAYDeprecated.502 Bad Gatewaystatic ResponsePredicateSC_BAD_REQUESTDeprecated.400 Bad Requeststatic ResponsePredicateSC_CLIENT_ERRORSDeprecated.Any 4XX client errorstatic ResponsePredicateSC_CONFLICTDeprecated.409 Conflictstatic ResponsePredicateSC_CONTINUEDeprecated.100 Continuestatic ResponsePredicateSC_CREATEDDeprecated.201 Createdstatic ResponsePredicateSC_EARLY_HINTSDeprecated.103 Early Hintsstatic ResponsePredicateSC_EXPECTATION_FAILEDDeprecated.417 Expectation Failedstatic ResponsePredicateSC_FAILED_DEPENDENCYDeprecated.424 Failed Dependency (WebDAV, RFC4918)static ResponsePredicateSC_FORBIDDENDeprecated.403 Forbiddenstatic ResponsePredicateSC_FOUNDDeprecated.302 Foundstatic ResponsePredicateSC_GATEWAY_TIMEOUTDeprecated.504 Gateway Timeoutstatic ResponsePredicateSC_GONEDeprecated.410 Gonestatic ResponsePredicateSC_HTTP_VERSION_NOT_SUPPORTEDDeprecated.505 HTTP Version Not Supportedstatic ResponsePredicateSC_INFORMATIONAL_RESPONSEDeprecated.Any 1XX informational responsestatic ResponsePredicateSC_INSUFFICIENT_STORAGEDeprecated.507 Insufficient Storage (WebDAV, RFC4918)static ResponsePredicateSC_INTERNAL_SERVER_ERRORDeprecated.500 Internal Server Errorstatic ResponsePredicateSC_LENGTH_REQUIREDDeprecated.411 Length Requiredstatic ResponsePredicateSC_LOCKEDDeprecated.423 Locked (WebDAV, RFC4918)static ResponsePredicateSC_METHOD_NOT_ALLOWEDDeprecated.405 Method Not Allowedstatic ResponsePredicateSC_MISDIRECTED_REQUESTDeprecated.421 Misdirected Requeststatic ResponsePredicateSC_MOVED_PERMANENTLYDeprecated.301 Moved Permanentlystatic ResponsePredicateSC_MULTI_STATUSDeprecated.207 Multi-Status (WebDAV, RFC2518)static ResponsePredicateSC_MULTIPLE_CHOICESDeprecated.300 Multiple Choicesstatic ResponsePredicateSC_NETWORK_AUTHENTICATION_REQUIREDDeprecated.511 Network Authentication Required (RFC6585)static ResponsePredicateSC_NO_CONTENTDeprecated.204 No Contentstatic ResponsePredicateSC_NON_AUTHORITATIVE_INFORMATIONDeprecated.203 Non-Authoritative Information (since HTTP/1.1)static ResponsePredicateSC_NOT_ACCEPTABLEDeprecated.406 Not Acceptablestatic ResponsePredicateSC_NOT_EXTENDEDDeprecated.510 Not Extended (RFC2774)static ResponsePredicateSC_NOT_FOUNDDeprecated.404 Not Foundstatic ResponsePredicateSC_NOT_IMPLEMENTEDDeprecated.501 Not Implementedstatic ResponsePredicateSC_NOT_MODIFIEDDeprecated.304 Not Modifiedstatic ResponsePredicateSC_OKDeprecated.200 OKstatic ResponsePredicateSC_PARTIAL_CONTENTDeprecated.206 Partial Contentstatic ResponsePredicateSC_PAYMENT_REQUIREDDeprecated.402 Payment Requiredstatic ResponsePredicateSC_PERMANENT_REDIRECTDeprecated.308 Permanent Redirect (RFC7538)static ResponsePredicateSC_PRECONDITION_FAILEDDeprecated.412 Precondition Failedstatic ResponsePredicateSC_PRECONDITION_REQUIREDDeprecated.428 Precondition Required (RFC6585)static ResponsePredicateSC_PROCESSINGDeprecated.102 Processing (WebDAV, RFC2518)static ResponsePredicateSC_PROXY_AUTHENTICATION_REQUIREDDeprecated.407 Proxy Authentication Requiredstatic ResponsePredicateSC_REDIRECTIONDeprecated.Any 3XX redirectionstatic ResponsePredicateSC_REQUEST_ENTITY_TOO_LARGEDeprecated.413 Request Entity Too Largestatic ResponsePredicateSC_REQUEST_HEADER_FIELDS_TOO_LARGEDeprecated.431 Request Header Fields Too Large (RFC6585)static ResponsePredicateSC_REQUEST_TIMEOUTDeprecated.408 Request Timeoutstatic ResponsePredicateSC_REQUEST_URI_TOO_LONGDeprecated.414 Request-URI Too Longstatic ResponsePredicateSC_REQUESTED_RANGE_NOT_SATISFIABLEDeprecated.416 Requested Range Not Satisfiablestatic ResponsePredicateSC_RESET_CONTENTDeprecated.205 Reset Contentstatic ResponsePredicateSC_SEE_OTHERDeprecated.303 See Other (since HTTP/1.1)static ResponsePredicateSC_SERVER_ERRORSDeprecated.Any 5XX server errorstatic ResponsePredicateSC_SERVICE_UNAVAILABLEDeprecated.503 Service Unavailablestatic ResponsePredicateSC_SUCCESSDeprecated.Any 2XX successstatic ResponsePredicateSC_SWITCHING_PROTOCOLSDeprecated.101 Switching Protocolsstatic ResponsePredicateSC_TEMPORARY_REDIRECTDeprecated.307 Temporary Redirect (since HTTP/1.1)static ResponsePredicateSC_TOO_MANY_REQUESTSDeprecated.429 Too Many Requests (RFC6585)static ResponsePredicateSC_UNAUTHORIZEDDeprecated.401 Unauthorizedstatic ResponsePredicateSC_UNORDERED_COLLECTIONDeprecated.425 Unordered Collection (WebDAV, RFC3648)static ResponsePredicateSC_UNPROCESSABLE_ENTITYDeprecated.422 Unprocessable Entity (WebDAV, RFC4918)static ResponsePredicateSC_UNSUPPORTED_MEDIA_TYPEDeprecated.415 Unsupported Media Typestatic ResponsePredicateSC_UPGRADE_REQUIREDDeprecated.426 Upgrade Required (RFC2817)static ResponsePredicateSC_USE_PROXYDeprecated.305 Use Proxy (since HTTP/1.1)static ResponsePredicateSC_VARIANT_ALSO_NEGOTIATESDeprecated.506 Variant Also Negotiates (RFC2295)
-
Constructor Summary
Constructors Constructor Description ResponsePredicate(ResponsePredicate delegate)Deprecated.ResponsePredicate(Object delegate)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ResponsePredicateResultapply(HttpResponse<Void> in)Deprecated.static ResponsePredicatecontentType(String mimeType)Deprecated.static ResponsePredicatecontentType(List<String> mimeTypes)Deprecated.static ResponsePredicatecreate(Function<HttpResponse<Void>,ResponsePredicateResult> test)Deprecated.static ResponsePredicatecreate(Function<HttpResponse<Void>,ResponsePredicateResult> test, ErrorConverter errorConverter)Deprecated.booleanequals(Object o)Deprecated.ErrorConvertererrorConverter()Deprecated.ResponsePredicategetDelegate()Deprecated.inthashCode()Deprecated.static ResponsePredicatenewInstance(ResponsePredicate arg)Deprecated.static ResponsePredicatestatus(int statusCode)Deprecated.static ResponsePredicatestatus(int min, int max)Deprecated.StringtoString()Deprecated.
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<ResponsePredicate> __TYPE_ARG
Deprecated.
-
SC_INFORMATIONAL_RESPONSE
public static final ResponsePredicate SC_INFORMATIONAL_RESPONSE
Deprecated.Any 1XX informational response
-
SC_CONTINUE
public static final ResponsePredicate SC_CONTINUE
Deprecated.100 Continue
-
SC_SWITCHING_PROTOCOLS
public static final ResponsePredicate SC_SWITCHING_PROTOCOLS
Deprecated.101 Switching Protocols
-
SC_PROCESSING
public static final ResponsePredicate SC_PROCESSING
Deprecated.102 Processing (WebDAV, RFC2518)
-
SC_EARLY_HINTS
public static final ResponsePredicate SC_EARLY_HINTS
Deprecated.103 Early Hints
-
SC_SUCCESS
public static final ResponsePredicate SC_SUCCESS
Deprecated.Any 2XX success
-
SC_OK
public static final ResponsePredicate SC_OK
Deprecated.200 OK
-
SC_CREATED
public static final ResponsePredicate SC_CREATED
Deprecated.201 Created
-
SC_ACCEPTED
public static final ResponsePredicate SC_ACCEPTED
Deprecated.202 Accepted
-
SC_NON_AUTHORITATIVE_INFORMATION
public static final ResponsePredicate SC_NON_AUTHORITATIVE_INFORMATION
Deprecated.203 Non-Authoritative Information (since HTTP/1.1)
-
SC_NO_CONTENT
public static final ResponsePredicate SC_NO_CONTENT
Deprecated.204 No Content
-
SC_RESET_CONTENT
public static final ResponsePredicate SC_RESET_CONTENT
Deprecated.205 Reset Content
-
SC_PARTIAL_CONTENT
public static final ResponsePredicate SC_PARTIAL_CONTENT
Deprecated.206 Partial Content
-
SC_MULTI_STATUS
public static final ResponsePredicate SC_MULTI_STATUS
Deprecated.207 Multi-Status (WebDAV, RFC2518)
-
SC_REDIRECTION
public static final ResponsePredicate SC_REDIRECTION
Deprecated.Any 3XX redirection
-
SC_MULTIPLE_CHOICES
public static final ResponsePredicate SC_MULTIPLE_CHOICES
Deprecated.300 Multiple Choices
-
SC_MOVED_PERMANENTLY
public static final ResponsePredicate SC_MOVED_PERMANENTLY
Deprecated.301 Moved Permanently
-
SC_FOUND
public static final ResponsePredicate SC_FOUND
Deprecated.302 Found
-
SC_SEE_OTHER
public static final ResponsePredicate SC_SEE_OTHER
Deprecated.303 See Other (since HTTP/1.1)
-
SC_NOT_MODIFIED
public static final ResponsePredicate SC_NOT_MODIFIED
Deprecated.304 Not Modified
-
SC_USE_PROXY
public static final ResponsePredicate SC_USE_PROXY
Deprecated.305 Use Proxy (since HTTP/1.1)
-
SC_TEMPORARY_REDIRECT
public static final ResponsePredicate SC_TEMPORARY_REDIRECT
Deprecated.307 Temporary Redirect (since HTTP/1.1)
-
SC_PERMANENT_REDIRECT
public static final ResponsePredicate SC_PERMANENT_REDIRECT
Deprecated.308 Permanent Redirect (RFC7538)
-
SC_CLIENT_ERRORS
public static final ResponsePredicate SC_CLIENT_ERRORS
Deprecated.Any 4XX client error
-
SC_BAD_REQUEST
public static final ResponsePredicate SC_BAD_REQUEST
Deprecated.400 Bad Request
-
SC_UNAUTHORIZED
public static final ResponsePredicate SC_UNAUTHORIZED
Deprecated.401 Unauthorized
-
SC_PAYMENT_REQUIRED
public static final ResponsePredicate SC_PAYMENT_REQUIRED
Deprecated.402 Payment Required
-
SC_FORBIDDEN
public static final ResponsePredicate SC_FORBIDDEN
Deprecated.403 Forbidden
-
SC_NOT_FOUND
public static final ResponsePredicate SC_NOT_FOUND
Deprecated.404 Not Found
-
SC_METHOD_NOT_ALLOWED
public static final ResponsePredicate SC_METHOD_NOT_ALLOWED
Deprecated.405 Method Not Allowed
-
SC_NOT_ACCEPTABLE
public static final ResponsePredicate SC_NOT_ACCEPTABLE
Deprecated.406 Not Acceptable
-
SC_PROXY_AUTHENTICATION_REQUIRED
public static final ResponsePredicate SC_PROXY_AUTHENTICATION_REQUIRED
Deprecated.407 Proxy Authentication Required
-
SC_REQUEST_TIMEOUT
public static final ResponsePredicate SC_REQUEST_TIMEOUT
Deprecated.408 Request Timeout
-
SC_CONFLICT
public static final ResponsePredicate SC_CONFLICT
Deprecated.409 Conflict
-
SC_GONE
public static final ResponsePredicate SC_GONE
Deprecated.410 Gone
-
SC_LENGTH_REQUIRED
public static final ResponsePredicate SC_LENGTH_REQUIRED
Deprecated.411 Length Required
-
SC_PRECONDITION_FAILED
public static final ResponsePredicate SC_PRECONDITION_FAILED
Deprecated.412 Precondition Failed
-
SC_REQUEST_ENTITY_TOO_LARGE
public static final ResponsePredicate SC_REQUEST_ENTITY_TOO_LARGE
Deprecated.413 Request Entity Too Large
-
SC_REQUEST_URI_TOO_LONG
public static final ResponsePredicate SC_REQUEST_URI_TOO_LONG
Deprecated.414 Request-URI Too Long
-
SC_UNSUPPORTED_MEDIA_TYPE
public static final ResponsePredicate SC_UNSUPPORTED_MEDIA_TYPE
Deprecated.415 Unsupported Media Type
-
SC_REQUESTED_RANGE_NOT_SATISFIABLE
public static final ResponsePredicate SC_REQUESTED_RANGE_NOT_SATISFIABLE
Deprecated.416 Requested Range Not Satisfiable
-
SC_EXPECTATION_FAILED
public static final ResponsePredicate SC_EXPECTATION_FAILED
Deprecated.417 Expectation Failed
-
SC_MISDIRECTED_REQUEST
public static final ResponsePredicate SC_MISDIRECTED_REQUEST
Deprecated.421 Misdirected Request
-
SC_UNPROCESSABLE_ENTITY
public static final ResponsePredicate SC_UNPROCESSABLE_ENTITY
Deprecated.422 Unprocessable Entity (WebDAV, RFC4918)
-
SC_LOCKED
public static final ResponsePredicate SC_LOCKED
Deprecated.423 Locked (WebDAV, RFC4918)
-
SC_FAILED_DEPENDENCY
public static final ResponsePredicate SC_FAILED_DEPENDENCY
Deprecated.424 Failed Dependency (WebDAV, RFC4918)
-
SC_UNORDERED_COLLECTION
public static final ResponsePredicate SC_UNORDERED_COLLECTION
Deprecated.425 Unordered Collection (WebDAV, RFC3648)
-
SC_UPGRADE_REQUIRED
public static final ResponsePredicate SC_UPGRADE_REQUIRED
Deprecated.426 Upgrade Required (RFC2817)
-
SC_PRECONDITION_REQUIRED
public static final ResponsePredicate SC_PRECONDITION_REQUIRED
Deprecated.428 Precondition Required (RFC6585)
-
SC_TOO_MANY_REQUESTS
public static final ResponsePredicate SC_TOO_MANY_REQUESTS
Deprecated.429 Too Many Requests (RFC6585)
-
SC_REQUEST_HEADER_FIELDS_TOO_LARGE
public static final ResponsePredicate SC_REQUEST_HEADER_FIELDS_TOO_LARGE
Deprecated.431 Request Header Fields Too Large (RFC6585)
-
SC_SERVER_ERRORS
public static final ResponsePredicate SC_SERVER_ERRORS
Deprecated.Any 5XX server error
-
SC_INTERNAL_SERVER_ERROR
public static final ResponsePredicate SC_INTERNAL_SERVER_ERROR
Deprecated.500 Internal Server Error
-
SC_NOT_IMPLEMENTED
public static final ResponsePredicate SC_NOT_IMPLEMENTED
Deprecated.501 Not Implemented
-
SC_BAD_GATEWAY
public static final ResponsePredicate SC_BAD_GATEWAY
Deprecated.502 Bad Gateway
-
SC_SERVICE_UNAVAILABLE
public static final ResponsePredicate SC_SERVICE_UNAVAILABLE
Deprecated.503 Service Unavailable
-
SC_GATEWAY_TIMEOUT
public static final ResponsePredicate SC_GATEWAY_TIMEOUT
Deprecated.504 Gateway Timeout
-
SC_HTTP_VERSION_NOT_SUPPORTED
public static final ResponsePredicate SC_HTTP_VERSION_NOT_SUPPORTED
Deprecated.505 HTTP Version Not Supported
-
SC_VARIANT_ALSO_NEGOTIATES
public static final ResponsePredicate SC_VARIANT_ALSO_NEGOTIATES
Deprecated.506 Variant Also Negotiates (RFC2295)
-
SC_INSUFFICIENT_STORAGE
public static final ResponsePredicate SC_INSUFFICIENT_STORAGE
Deprecated.507 Insufficient Storage (WebDAV, RFC4918)
-
SC_NOT_EXTENDED
public static final ResponsePredicate SC_NOT_EXTENDED
Deprecated.510 Not Extended (RFC2774)
-
SC_NETWORK_AUTHENTICATION_REQUIRED
public static final ResponsePredicate SC_NETWORK_AUTHENTICATION_REQUIRED
Deprecated.511 Network Authentication Required (RFC6585)
-
JSON
public static final ResponsePredicate JSON
Deprecated.Creates a predicate validating the responsecontent-typeisapplication/json.
-
-
Constructor Detail
-
ResponsePredicate
public ResponsePredicate(ResponsePredicate delegate)
Deprecated.
-
ResponsePredicate
public ResponsePredicate(Object delegate)
Deprecated.
-
-
Method Detail
-
apply
public ResponsePredicateResult apply(HttpResponse<Void> in)
Deprecated.- Specified by:
applyin interfaceFunction<HttpResponse<Void>,ResponsePredicateResult>
-
getDelegate
public ResponsePredicate getDelegate()
Deprecated.- Specified by:
getDelegatein interfaceRxDelegate
-
status
@Deprecated public static ResponsePredicate status(int statusCode)
Deprecated.Creates a predicate asserting that the status response code is equal tostatusCode.- Parameters:
statusCode- the expected status code- Returns:
-
status
@Deprecated public static ResponsePredicate status(int min, int max)
Deprecated.Creates a predicate asserting that the status response code is in the[min,max[range.- Parameters:
min- the lower (inclusive) accepted status codemax- the highest (exclusive) accepted status code- Returns:
-
contentType
@Deprecated public static ResponsePredicate contentType(String mimeType)
Deprecated.Creates a predicate validating the response has acontent-typeheader matching themimeType.- Parameters:
mimeType- the mime type- Returns:
-
contentType
@Deprecated public static ResponsePredicate contentType(List<String> mimeTypes)
Deprecated.Creates a predicate validating the response has acontent-typeheader matching one of themimeTypes.- Parameters:
mimeTypes- the list of mime types- Returns:
-
create
@Deprecated public static ResponsePredicate create(Function<HttpResponse<Void>,ResponsePredicateResult> test)
Deprecated.Creates a newResponsePredicate. The default error converter will be used (discarding the body).- Parameters:
test- the function to invoke when the response is received- Returns:
-
create
@Deprecated public static ResponsePredicate create(Function<HttpResponse<Void>,ResponsePredicateResult> test, ErrorConverter errorConverter)
Deprecated.Creates a newResponsePredicate, using a customerrorConverter.- Parameters:
test- the function to invoke when the response is receivederrorConverter- converts the result of thetestfunction to aThrowable- Returns:
-
errorConverter
@Deprecated public ErrorConverter errorConverter()
Deprecated.- Returns:
- the error converter currently used
-
newInstance
public static ResponsePredicate newInstance(ResponsePredicate arg)
Deprecated.
-
-