public class Routes extends Object
Route instances that are able to handle certain RequestMethod/requestURI
combinations.
This class also provides static factory methods for creating Routes instances.| Modifier | Constructor and Description |
|---|---|
private |
Routes(List<RouteBuilder> routeBuilders) |
| Modifier and Type | Method and Description |
|---|---|
static Routes |
from(List<RouteBuilder> routes)
Factory method that constructs a
Routes instance using the list of RouteBuilders provided. |
boolean |
hasRouteFor(RequestMethod method,
String requestURI,
Set<String> acceptHeaders)
Determines is there is a Route for the
RequestMethod/URI combination. |
static RouteBuilder |
route()
Simple Factory method for creating a
RouteBuilder which is used to define a route. |
Route |
routeFor(RequestMethod method,
String requestURI,
Set<String> acceptHeaders)
Returns the
Route for the specified RequestMethod/URI combination. |
Route |
routeFor(Throwable throwable)
|
String |
toString() |
private Routes(List<RouteBuilder> routeBuilders)
public static RouteBuilder route()
RouteBuilder which is used to define a route.RouteBuilder which can be used to gather information about a Route.public static Routes from(List<RouteBuilder> routes)
Routes instance using the list of RouteBuilders provided.routes - the list of RouteBuilders which will be used to create the Routes.Routes with the Routes from the passed in list of RouteBuilders.public boolean hasRouteFor(RequestMethod method, String requestURI, Set<String> acceptHeaders)
RequestMethod/URI combination.method - the HTTP RequestMethod.requestURI - the URI.acceptHeaders - the accept headers provided, or an empty set if none were provided.true if this Routes has a Route for the specified RequestMethod/URI combinationpublic Route routeFor(RequestMethod method, String requestURI, Set<String> acceptHeaders)
Route for the specified RequestMethod/URI combination.method - the HTTP RequestMethod.requestURI - the URI.acceptHeaders - the accept headers provided, or an empty set if none were provided.Route configured to server the RequestMethod/URI combination. Will throw a RuntimeException if
the specified RequestMethod/URI combination is not supported by this Routes instance.Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.