/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.vertx.reactivex.ext.web;

import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import java.util.Map;
import io.vertx.core.json.JsonObject;
import java.util.Set;
import io.vertx.core.json.JsonArray;
import java.util.List;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.Handler;

Represents the context for the handling of a request in Vert.x-Web.

A new instance is created for each HTTP request that is received in the of the router.

The same instance is passed to any matching request or failure handlers during the routing of the request or failure.

The context provides access to the and and allows you to maintain arbitrary data that lives for the lifetime of the context. Contexts are discarded once they have been routed to the handler for the request.

The context also provides access to the Session, cookies and body for the request, given the correct handlers in the application.

If you use the internal error handler

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * Represents the context for the handling of a request in Vert.x-Web. * <p> * A new instance is created for each HTTP request that is received in the * of the router. * <p> * The same instance is passed to any matching request or failure handlers during the routing of the request or * failure. * <p> * The context provides access to the and * and allows you to maintain arbitrary data that lives for the lifetime of the context. Contexts are discarded once they * have been routed to the handler for the request. * <p> * The context also provides access to the {@link io.vertx.reactivex.ext.web.Session}, cookies and body for the request, given the correct handlers * in the application. * <p> * If you use the internal error handler * * <p/> * NOTE: This class has been automatically generated from the {@link io.vertx.ext.web.RoutingContext original} non RX-ified interface using Vert.x codegen. */
@io.vertx.lang.rx.RxGen(io.vertx.ext.web.RoutingContext.class) public class RoutingContext { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RoutingContext that = (RoutingContext) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final io.vertx.lang.rx.TypeArg<RoutingContext> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new RoutingContext((io.vertx.ext.web.RoutingContext) obj), RoutingContext::getDelegate ); private final io.vertx.ext.web.RoutingContext delegate; public RoutingContext(io.vertx.ext.web.RoutingContext delegate) { this.delegate = delegate; } public io.vertx.ext.web.RoutingContext getDelegate() { return delegate; }
Returns:the HTTP request object
/** * @return the HTTP request object */
public io.vertx.reactivex.core.http.HttpServerRequest request() { if (cached_0 != null) { return cached_0; } io.vertx.reactivex.core.http.HttpServerRequest ret = io.vertx.reactivex.core.http.HttpServerRequest.newInstance(delegate.request()); cached_0 = ret; return ret; }
Returns:the HTTP response object
/** * @return the HTTP response object */
public io.vertx.reactivex.core.http.HttpServerResponse response() { if (cached_1 != null) { return cached_1; } io.vertx.reactivex.core.http.HttpServerResponse ret = io.vertx.reactivex.core.http.HttpServerResponse.newInstance(delegate.response()); cached_1 = ret; return ret; }
Tell the router to route this context to the next matching route (if any). This method, if called, does not need to be called during the execution of the handler, it can be called some arbitrary time later, if required.

If next is not called for a handler then the handler should make sure it ends the response or no response will be sent.

/** * Tell the router to route this context to the next matching route (if any). * This method, if called, does not need to be called during the execution of the handler, it can be called * some arbitrary time later, if required. * <p> * If next is not called for a handler then the handler should make sure it ends the response or no response * will be sent. */
public void next() { delegate.next(); }
Fail the context with the specified status code.

This will cause the router to route the context to any matching failure handlers for the request. If no failure handlers match It will trigger the error handler matching the status code. You can define such error handler with Router.errorHandler. If no error handler is not defined, It will send a default failure response with provided status code.

Params:
  • statusCode – the HTTP status code
/** * Fail the context with the specified status code. * <p> * This will cause the router to route the context to any matching failure handlers for the request. If no failure handlers * match It will trigger the error handler matching the status code. You can define such error handler with * {@link io.vertx.reactivex.ext.web.Router#errorHandler}. If no error handler is not defined, It will send a default failure response with provided status code. * @param statusCode the HTTP status code */
public void fail(int statusCode) { delegate.fail(statusCode); }
Fail the context with the specified throwable and 500 status code.

This will cause the router to route the context to any matching failure handlers for the request. If no failure handlers match It will trigger the error handler matching the status code. You can define such error handler with Router.errorHandler. If no error handler is not defined, It will send a default failure response with 500 status code.

Params:
  • throwable – a throwable representing the failure
/** * Fail the context with the specified throwable and 500 status code. * <p> * This will cause the router to route the context to any matching failure handlers for the request. If no failure handlers * match It will trigger the error handler matching the status code. You can define such error handler with * {@link io.vertx.reactivex.ext.web.Router#errorHandler}. If no error handler is not defined, It will send a default failure response with 500 status code. * @param throwable a throwable representing the failure */
public void fail(Throwable throwable) { delegate.fail(throwable); }
Fail the context with the specified throwable and the specified the status code.

This will cause the router to route the context to any matching failure handlers for the request. If no failure handlers match It will trigger the error handler matching the status code. You can define such error handler with Router.errorHandler. If no error handler is not defined, It will send a default failure response with provided status code.

Params:
  • statusCode – the HTTP status code
  • throwable – a throwable representing the failure
/** * Fail the context with the specified throwable and the specified the status code. * <p> * This will cause the router to route the context to any matching failure handlers for the request. If no failure handlers * match It will trigger the error handler matching the status code. You can define such error handler with * {@link io.vertx.reactivex.ext.web.Router#errorHandler}. If no error handler is not defined, It will send a default failure response with provided status code. * @param statusCode the HTTP status code * @param throwable a throwable representing the failure */
public void fail(int statusCode, Throwable throwable) { delegate.fail(statusCode, throwable); }
Put some arbitrary data in the context. This will be available in any handlers that receive the context.
Params:
  • key – the key for the data
  • obj – the data
Returns:a reference to this, so the API can be used fluently
/** * Put some arbitrary data in the context. This will be available in any handlers that receive the context. * @param key the key for the data * @param obj the data * @return a reference to this, so the API can be used fluently */
public io.vertx.reactivex.ext.web.RoutingContext put(String key, Object obj) { delegate.put(key, obj); return this; }
Get some data from the context. The data is available in any handlers that receive the context.
Params:
  • key – the key for the data
Returns:the data
/** * Get some data from the context. The data is available in any handlers that receive the context. * @param key the key for the data * @return the data */
public <T> T get(String key) { T ret = (T) delegate.get(key); return ret; }
Remove some data from the context. The data is available in any handlers that receive the context.
Params:
  • key – the key for the data
Returns:the previous data associated with the key
/** * Remove some data from the context. The data is available in any handlers that receive the context. * @param key the key for the data * @return the previous data associated with the key */
public <T> T remove(String key) { T ret = (T) delegate.remove(key); return ret; }
Returns:the Vert.x instance associated to the initiating Router for this context
/** * @return the Vert.x instance associated to the initiating {@link io.vertx.reactivex.ext.web.Router} for this context */
public io.vertx.reactivex.core.Vertx vertx() { if (cached_2 != null) { return cached_2; } io.vertx.reactivex.core.Vertx ret = io.vertx.reactivex.core.Vertx.newInstance(delegate.vertx()); cached_2 = ret; return ret; }
Returns:the mount point for this router. It will be null for a top level router. For a sub-router it will be the path at which the subrouter was mounted.
/** * @return the mount point for this router. It will be null for a top level router. For a sub-router it will be the path at which the subrouter was mounted. */
public String mountPoint() { String ret = delegate.mountPoint(); return ret; }
Returns:the current route this context is being routed through.
/** * @return the current route this context is being routed through. */
public io.vertx.reactivex.ext.web.Route currentRoute() { io.vertx.reactivex.ext.web.Route ret = io.vertx.reactivex.ext.web.Route.newInstance(delegate.currentRoute()); return ret; }
Return the normalised path for the request.

The normalised path is where the URI path has been decoded, i.e. any unicode or other illegal URL characters that were encoded in the original URL with `%` will be returned to their original form. E.g. `%20` will revert to a space. Also `+` reverts to a space in a query.

The normalised path will also not contain any `..` character sequences to prevent resources being accessed outside of the permitted area.

It's recommended to always use the normalised path as opposed to if accessing server resources requested by a client.

Returns:the normalised path
/** * Return the normalised path for the request. * <p> * The normalised path is where the URI path has been decoded, i.e. any unicode or other illegal URL characters that * were encoded in the original URL with `%` will be returned to their original form. E.g. `%20` will revert to a space. * Also `+` reverts to a space in a query. * <p> * The normalised path will also not contain any `..` character sequences to prevent resources being accessed outside * of the permitted area. * <p> * It's recommended to always use the normalised path as opposed to * if accessing server resources requested by a client. * @return the normalised path */
public String normalisedPath() { String ret = delegate.normalisedPath(); return ret; }
Get the cookie with the specified name. The context must have first been routed to a CookieHandler for this to work.
Params:
  • name – the cookie name
Returns:the cookie
/** * Get the cookie with the specified name. The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.CookieHandler} * for this to work. * @param name the cookie name * @return the cookie */
public io.vertx.reactivex.ext.web.Cookie getCookie(String name) { io.vertx.reactivex.ext.web.Cookie ret = io.vertx.reactivex.ext.web.Cookie.newInstance(delegate.getCookie(name)); return ret; }
Add a cookie. This will be sent back to the client in the response. The context must have first been routed to a CookieHandler for this to work.
Params:
  • cookie – the cookie
Returns:a reference to this, so the API can be used fluently
/** * Add a cookie. This will be sent back to the client in the response. The context must have first been routed * to a {@link io.vertx.reactivex.ext.web.handler.CookieHandler} for this to work. * @param cookie the cookie * @return a reference to this, so the API can be used fluently */
public io.vertx.reactivex.ext.web.RoutingContext addCookie(io.vertx.reactivex.ext.web.Cookie cookie) { delegate.addCookie(cookie.getDelegate()); return this; }
Expire a cookie, notifying a User Agent to remove it from its cookie jar. The context must have first been routed to a CookieHandler for this to work.
Params:
  • name – the name of the cookie
Returns:the cookie, if it existed, or null
/** * Expire a cookie, notifying a User Agent to remove it from its cookie jar. The context must have first been routed * to a {@link io.vertx.reactivex.ext.web.handler.CookieHandler} for this to work. * @param name the name of the cookie * @return the cookie, if it existed, or null */
public io.vertx.reactivex.ext.web.Cookie removeCookie(String name) { io.vertx.reactivex.ext.web.Cookie ret = io.vertx.reactivex.ext.web.Cookie.newInstance(delegate.removeCookie(name)); return ret; }
Remove a cookie from the cookie set. If invalidate is true then it will expire a cookie, notifying a User Agent to remove it from its cookie jar. The context must have first been routed to a CookieHandler for this to work.
Params:
  • name – the name of the cookie
  • invalidate –
Returns:the cookie, if it existed, or null
/** * Remove a cookie from the cookie set. If invalidate is true then it will expire a cookie, notifying a User Agent to * remove it from its cookie jar. The context must have first been routed to a * {@link io.vertx.reactivex.ext.web.handler.CookieHandler} for this to work. * @param name the name of the cookie * @param invalidate * @return the cookie, if it existed, or null */
public io.vertx.reactivex.ext.web.Cookie removeCookie(String name, boolean invalidate) { io.vertx.reactivex.ext.web.Cookie ret = io.vertx.reactivex.ext.web.Cookie.newInstance(delegate.removeCookie(name, invalidate)); return ret; }
Returns:the number of cookies. The context must have first been routed to a CookieHandler for this to work.
/** * @return the number of cookies. The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.CookieHandler} for this to work. */
public int cookieCount() { int ret = delegate.cookieCount(); return ret; }
Returns:a set of all the cookies. The context must have first been routed to a CookieHandler for this to be populated.
/** * @return a set of all the cookies. The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.CookieHandler} for this to be populated. */
public Set<io.vertx.reactivex.ext.web.Cookie> cookies() { Set<io.vertx.reactivex.ext.web.Cookie> ret = delegate.cookies().stream().map(elt -> io.vertx.reactivex.ext.web.Cookie.newInstance(elt)).collect(java.util.stream.Collectors.toSet()); return ret; }
Returns:the entire HTTP request body as a string, assuming UTF-8 encoding. The context must have first been routed to a BodyHandler for this to be populated.
/** * @return the entire HTTP request body as a string, assuming UTF-8 encoding. The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.BodyHandler} for this to be populated. */
public String getBodyAsString() { String ret = delegate.getBodyAsString(); return ret; }
Get the entire HTTP request body as a string, assuming the specified encoding. The context must have first been routed to a BodyHandler for this to be populated.
Params:
  • encoding – the encoding, e.g. "UTF-16"
Returns:the body
/** * Get the entire HTTP request body as a string, assuming the specified encoding. The context must have first been routed to a * {@link io.vertx.reactivex.ext.web.handler.BodyHandler} for this to be populated. * @param encoding the encoding, e.g. "UTF-16" * @return the body */
public String getBodyAsString(String encoding) { String ret = delegate.getBodyAsString(encoding); return ret; }
Returns:Get the entire HTTP request body as a . The context must have first been routed to a BodyHandler for this to be populated.
When the body is null or the "null" JSON literal then null is returned.
/** * @return Get the entire HTTP request body as a . The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.BodyHandler} for this to be populated. <br/> When the body is <code>null</code> or the <code>"null"</code> JSON literal then <code>null</code> is returned. */
public JsonObject getBodyAsJson() { JsonObject ret = delegate.getBodyAsJson(); return ret; }
Returns:Get the entire HTTP request body as a . The context must have first been routed to a BodyHandler for this to be populated.
When the body is null or the "null" JSON literal then null is returned.
/** * @return Get the entire HTTP request body as a . The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.BodyHandler} for this to be populated. <br/> When the body is <code>null</code> or the <code>"null"</code> JSON literal then <code>null</code> is returned. */
public JsonArray getBodyAsJsonArray() { JsonArray ret = delegate.getBodyAsJsonArray(); return ret; }
Returns:Get the entire HTTP request body as a . The context must have first been routed to a BodyHandler for this to be populated.
/** * @return Get the entire HTTP request body as a . The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.BodyHandler} for this to be populated. */
public io.vertx.reactivex.core.buffer.Buffer getBody() { io.vertx.reactivex.core.buffer.Buffer ret = io.vertx.reactivex.core.buffer.Buffer.newInstance(delegate.getBody()); return ret; }
Returns:a set of fileuploads (if any) for the request. The context must have first been routed to a BodyHandler for this to work.
/** * @return a set of fileuploads (if any) for the request. The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.BodyHandler} for this to work. */
public Set<io.vertx.reactivex.ext.web.FileUpload> fileUploads() { Set<io.vertx.reactivex.ext.web.FileUpload> ret = delegate.fileUploads().stream().map(elt -> io.vertx.reactivex.ext.web.FileUpload.newInstance(elt)).collect(java.util.stream.Collectors.toSet()); return ret; }
Get the session. The context must have first been routed to a SessionHandler for this to be populated. Sessions live for a browser session, and are maintained by session cookies.
Returns:the session.
/** * Get the session. The context must have first been routed to a {@link io.vertx.reactivex.ext.web.handler.SessionHandler} * for this to be populated. * Sessions live for a browser session, and are maintained by session cookies. * @return the session. */
public io.vertx.reactivex.ext.web.Session session() { io.vertx.reactivex.ext.web.Session ret = io.vertx.reactivex.ext.web.Session.newInstance(delegate.session()); return ret; }
Get the authenticated user (if any). This will usually be injected by an auth handler if authentication if successful.
Returns:the user, or null if the current user is not authenticated.
/** * Get the authenticated user (if any). This will usually be injected by an auth handler if authentication if successful. * @return the user, or null if the current user is not authenticated. */
public io.vertx.reactivex.ext.auth.User user() { io.vertx.reactivex.ext.auth.User ret = io.vertx.reactivex.ext.auth.User.newInstance(delegate.user()); return ret; }
If the context is being routed to failure handlers after a failure has been triggered by calling fail then this will return that throwable. It can be used by failure handlers to render a response, e.g. create a failure response page.
Returns:the throwable used when signalling failure
/** * If the context is being routed to failure handlers after a failure has been triggered by calling * {@link io.vertx.reactivex.ext.web.RoutingContext#fail} then this will return that throwable. It can be used by failure handlers to render a response, * e.g. create a failure response page. * @return the throwable used when signalling failure */
public Throwable failure() { if (cached_3 != null) { return cached_3; } Throwable ret = delegate.failure(); cached_3 = ret; return ret; }
If the context is being routed to failure handlers after a failure has been triggered by calling fail then this will return that status code. It can be used by failure handlers to render a response, e.g. create a failure response page. When the status code has not been set yet (it is undefined) its value will be -1.
Returns:the status code used when signalling failure
/** * If the context is being routed to failure handlers after a failure has been triggered by calling * {@link io.vertx.reactivex.ext.web.RoutingContext#fail} then this will return that status code. It can be used by failure handlers to render a response, * e.g. create a failure response page. * * When the status code has not been set yet (it is undefined) its value will be -1. * @return the status code used when signalling failure */
public int statusCode() { if (cached_4 != null) { return cached_4; } int ret = delegate.statusCode(); cached_4 = ret; return ret; }
If the route specifies produces matches, e.g. produces `text/html` and `text/plain`, and the `accept` header matches one or more of these then this returns the most acceptable match.
Returns:the most acceptable content type.
/** * If the route specifies produces matches, e.g. produces `text/html` and `text/plain`, and the `accept` header * matches one or more of these then this returns the most acceptable match. * @return the most acceptable content type. */
public String getAcceptableContentType() { String ret = delegate.getAcceptableContentType(); return ret; }
The headers:
  1. Accept
  2. Accept-Charset
  3. Accept-Encoding
  4. Accept-Language
  5. Content-Type
Parsed into ParsedHeaderValue
Returns:A container with the parsed headers.
/** * The headers: * <ol> * <li>Accept</li> * <li>Accept-Charset</li> * <li>Accept-Encoding</li> * <li>Accept-Language</li> * <li>Content-Type</li> * </ol> * Parsed into {@link io.vertx.reactivex.ext.web.ParsedHeaderValue} * @return A container with the parsed headers. */
public io.vertx.reactivex.ext.web.ParsedHeaderValues parsedHeaders() { if (cached_5 != null) { return cached_5; } io.vertx.reactivex.ext.web.ParsedHeaderValues ret = io.vertx.reactivex.ext.web.ParsedHeaderValues.newInstance(delegate.parsedHeaders()); cached_5 = ret; return ret; }
Add a handler that will be called just before headers are written to the response. This gives you a hook where you can write any extra headers before the response has been written when it will be too late.
Params:
  • handler – the handler
Returns:the id of the handler. This can be used if you later want to remove the handler.
/** * Add a handler that will be called just before headers are written to the response. This gives you a hook where * you can write any extra headers before the response has been written when it will be too late. * @param handler the handler * @return the id of the handler. This can be used if you later want to remove the handler. */
public int addHeadersEndHandler(Handler<Void> handler) { int ret = delegate.addHeadersEndHandler(handler); return ret; }
Remove a headers end handler
Params:
Returns:true if the handler existed and was removed, false otherwise
/** * Remove a headers end handler * @param handlerID the id as returned from {@link io.vertx.reactivex.ext.web.RoutingContext#addHeadersEndHandler}. * @return true if the handler existed and was removed, false otherwise */
public boolean removeHeadersEndHandler(int handlerID) { boolean ret = delegate.removeHeadersEndHandler(handlerID); return ret; }
Provides a handler that will be called after the last part of the body is written to the wire. The handler is called asynchronously of when the response has been received by the client. This provides a hook allowing you to do more operations once the request has been sent over the wire. Do not use this for resource cleanup as this handler might never get called (e.g. if the connection is reset).
Params:
  • handler – the handler
Returns:the id of the handler. This can be used if you later want to remove the handler.
/** * Provides a handler that will be called after the last part of the body is written to the wire. * The handler is called asynchronously of when the response has been received by the client. * This provides a hook allowing you to do more operations once the request has been sent over the wire. * Do not use this for resource cleanup as this handler might never get called (e.g. if the connection is reset). * @param handler the handler * @return the id of the handler. This can be used if you later want to remove the handler. */
public int addBodyEndHandler(Handler<Void> handler) { int ret = delegate.addBodyEndHandler(handler); return ret; }
Remove a body end handler
Params:
Returns:true if the handler existed and was removed, false otherwise
/** * Remove a body end handler * @param handlerID the id as returned from {@link io.vertx.reactivex.ext.web.RoutingContext#addBodyEndHandler}. * @return true if the handler existed and was removed, false otherwise */
public boolean removeBodyEndHandler(int handlerID) { boolean ret = delegate.removeBodyEndHandler(handlerID); return ret; }
Returns:true if the context is being routed to failure handlers.
/** * @return true if the context is being routed to failure handlers. */
public boolean failed() { boolean ret = delegate.failed(); return ret; }
Set the body. Used by the BodyHandler. You will not normally call this method.
Params:
  • body – the body
/** * Set the body. Used by the {@link io.vertx.reactivex.ext.web.handler.BodyHandler}. You will not normally call this method. * @param body the body */
public void setBody(io.vertx.reactivex.core.buffer.Buffer body) { delegate.setBody(body.getDelegate()); }
Set the session. Used by the SessionHandler. You will not normally call this method.
Params:
  • session – the session
/** * Set the session. Used by the {@link io.vertx.reactivex.ext.web.handler.SessionHandler}. You will not normally call this method. * @param session the session */
public void setSession(io.vertx.reactivex.ext.web.Session session) { delegate.setSession(session.getDelegate()); }
Set the user. Usually used by auth handlers to inject a User. You will not normally call this method.
Params:
  • user – the user
/** * Set the user. Usually used by auth handlers to inject a User. You will not normally call this method. * @param user the user */
public void setUser(io.vertx.reactivex.ext.auth.User user) { delegate.setUser(user.getDelegate()); }
Clear the current user object in the context. This usually is used for implementing a log out feature, since the current user is unbounded from the routing context.
/** * Clear the current user object in the context. This usually is used for implementing a log out feature, since the * current user is unbounded from the routing context. */
public void clearUser() { delegate.clearUser(); }
Set the acceptable content type. Used by
Params:
  • contentType – the content type
/** * Set the acceptable content type. Used by * @param contentType the content type */
public void setAcceptableContentType(String contentType) { delegate.setAcceptableContentType(contentType); }
Restarts the current router with a new path and reusing the original method. All path parameters are then parsed and available on the params list.
Params:
  • path – the new http path.
/** * Restarts the current router with a new path and reusing the original method. All path parameters are then parsed * and available on the params list. * @param path the new http path. */
public void reroute(String path) { delegate.reroute(path); }
Restarts the current router with a new method and path. All path parameters are then parsed and available on the params list.
Params:
  • method – the new http request
  • path – the new http path.
/** * Restarts the current router with a new method and path. All path parameters are then parsed and available on the * params list. * @param method the new http request * @param path the new http path. */
public void reroute(HttpMethod method, String path) { delegate.reroute(method, path); }
Returns the locales for the current request. The locales are determined from the `accept-languages` header and sorted on quality. When 2 or more entries have the same quality then the order used to return the best match is based on the lowest index on the original list. For example if a user has en-US and en-GB with same quality and this order the best match will be en-US because it was declared as first entry by the client.
Returns:the best matched locale for the request
/** * Returns the locales for the current request. The locales are determined from the `accept-languages` header and * sorted on quality. * * When 2 or more entries have the same quality then the order used to return the best match is based on the lowest * index on the original list. For example if a user has en-US and en-GB with same quality and this order the best * match will be en-US because it was declared as first entry by the client. * @return the best matched locale for the request */
@Deprecated() public List<io.vertx.reactivex.ext.web.Locale> acceptableLocales() { if (cached_6 != null) { return cached_6; } List<io.vertx.reactivex.ext.web.Locale> ret = delegate.acceptableLocales().stream().map(elt -> io.vertx.reactivex.ext.web.Locale.newInstance(elt)).collect(java.util.stream.Collectors.toList()); cached_6 = ret; return ret; }
Returns the languages for the current request. The languages are determined from the Accept-Language header and sorted on quality. When 2 or more entries have the same quality then the order used to return the best match is based on the lowest index on the original list. For example if a user has en-US and en-GB with same quality and this order the best match will be en-US because it was declared as first entry by the client.
Returns:The best matched language for the request
/** * Returns the languages for the current request. The languages are determined from the <code>Accept-Language</code> * header and sorted on quality. * * When 2 or more entries have the same quality then the order used to return the best match is based on the lowest * index on the original list. For example if a user has en-US and en-GB with same quality and this order the best * match will be en-US because it was declared as first entry by the client. * @return The best matched language for the request */
public List<io.vertx.reactivex.ext.web.LanguageHeader> acceptableLanguages() { if (cached_7 != null) { return cached_7; } List<io.vertx.reactivex.ext.web.LanguageHeader> ret = delegate.acceptableLanguages().stream().map(elt -> io.vertx.reactivex.ext.web.LanguageHeader.newInstance(elt)).collect(java.util.stream.Collectors.toList()); cached_7 = ret; return ret; }
Helper to return the user preferred locale. It is the same action as returning the first element of the acceptable locales.
Returns:the users preferred locale.
/** * Helper to return the user preferred locale. It is the same action as returning the first element of the acceptable * locales. * @return the users preferred locale. */
@Deprecated() public io.vertx.reactivex.ext.web.Locale preferredLocale() { if (cached_8 != null) { return cached_8; } io.vertx.reactivex.ext.web.Locale ret = io.vertx.reactivex.ext.web.Locale.newInstance(delegate.preferredLocale()); cached_8 = ret; return ret; }
Helper to return the user preferred language. It is the same action as returning the first element of the acceptable languages.
Returns:the users preferred locale.
/** * Helper to return the user preferred language. * It is the same action as returning the first element of the acceptable languages. * @return the users preferred locale. */
public io.vertx.reactivex.ext.web.LanguageHeader preferredLanguage() { if (cached_9 != null) { return cached_9; } io.vertx.reactivex.ext.web.LanguageHeader ret = io.vertx.reactivex.ext.web.LanguageHeader.newInstance(delegate.preferredLanguage()); cached_9 = ret; return ret; }
Returns a map of named parameters as defined in path declaration with their actual values
Returns:the map of named parameters
/** * Returns a map of named parameters as defined in path declaration with their actual values * @return the map of named parameters */
public Map<String, String> pathParams() { Map<String, String> ret = delegate.pathParams(); return ret; }
Gets the value of a single path parameter
Params:
  • name – the name of parameter as defined in path declaration
Returns:the actual value of the parameter or null if it doesn't exist
/** * Gets the value of a single path parameter * @param name the name of parameter as defined in path declaration * @return the actual value of the parameter or null if it doesn't exist */
public String pathParam(String name) { String ret = delegate.pathParam(name); return ret; }
Returns a map of all query parameters inside the query string
The query parameters are lazily decoded: the decoding happens on the first time this method is called. If the query string is invalid it fails the context
Returns:the multimap of query parameters
/** * Returns a map of all query parameters inside the <a href="https://en.wikipedia.org/wiki/Query_string">query string</a><br/> * The query parameters are lazily decoded: the decoding happens on the first time this method is called. If the query string is invalid * it fails the context * @return the multimap of query parameters */
public io.vertx.reactivex.core.MultiMap queryParams() { io.vertx.reactivex.core.MultiMap ret = io.vertx.reactivex.core.MultiMap.newInstance(delegate.queryParams()); return ret; }
Gets the value of a single query parameter. For more info queryParams
Params:
  • name – The name of query parameter
Returns:The list of all parameters matching the parameter name. It returns an empty list if no query parameter with name was found
/** * Gets the value of a single query parameter. For more info {@link io.vertx.reactivex.ext.web.RoutingContext#queryParams} * @param name The name of query parameter * @return The list of all parameters matching the parameter name. It returns an empty list if no query parameter with <code>name</code> was found */
public List<String> queryParam(String name) { List<String> ret = delegate.queryParam(name); return ret; }
Returns:all the context data as a map
/** * @return all the context data as a map */
public Map<String, Object> data() { Map<String, Object> ret = delegate.data(); return ret; } private io.vertx.reactivex.core.http.HttpServerRequest cached_0; private io.vertx.reactivex.core.http.HttpServerResponse cached_1; private io.vertx.reactivex.core.Vertx cached_2; private Throwable cached_3; private java.lang.Integer cached_4; private io.vertx.reactivex.ext.web.ParsedHeaderValues cached_5; private List<io.vertx.reactivex.ext.web.Locale> cached_6; private List<io.vertx.reactivex.ext.web.LanguageHeader> cached_7; private io.vertx.reactivex.ext.web.Locale cached_8; private io.vertx.reactivex.ext.web.LanguageHeader cached_9; public static RoutingContext newInstance(io.vertx.ext.web.RoutingContext arg) { return arg != null ? new RoutingContext(arg) : null; } }