Java-friendly version of Router
Exception thrown when an attempt to route an Input
to a Router where close() has been
initiated on the Router.
Exception thrown when a RouterBuilder encounters a Route
that is not valid for
the Router type it is building.
A generic interface for routing an input to an optional matching route.
A generic interface for routing an input to an optional matching route.
The Input type used when determining a route destination
The resulting route type. A Route may have dynamic properties and may be found to satisfy multiple Input instances. As there may not be a 1-to-1 mapping of Input to Route, it is encouraged that a Route encapsulates its relationship to an Input. An example to consider would be an HTTP Router. An HTTP request contains a Method (i.e. GET, POST) and a URI. A Router for a REST API may match "GET /users/{id}" for multiple HTTP requests (i.e. "GET /users/123" AND "GET /users/456" would map to the same destination Route). As a result, the Route in this example should be aware of the method, path, and and the destination/logic responsible for handling an Input that matches. Another property to consider for a Route is "uniqueness". It may or may not be desirable for a Router to contain multiple routes that correspond to the same Input.
A Router should be considered immutable unless explicitly noted.
Contract for a Router builder.
Contract for a Router builder. The resulting RouterType should be considered immutable, unless the RouterType implementation explicitly states otherwise.
The Router's Input
type.
The Router's destination Route
type. It is recommended that the Route
is a self-contained/self-describing type for the purpose of validation via
the routeValidator. Put differently, the Route
should know of the
Input
that maps to itself.
The type of Router to build.
Java-friendly version of Router
The Input type used to determine a route destination
The output/resulting route type