Package com.duncpro.jroute.router
Interface Router<E>
-
- All Known Implementing Classes:
DelegatingRouter,RestRouter,TreeRouter
public interface Router<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidadd(Route route, E endpoint)default voidadd(PositionedEndpoint<E> positionedEndpoint)default voidadd(java.lang.String routeString, E endpoint)java.util.Set<PositionedEndpoint<E>>getAllEndpoints(Route prefix)Returns a set ofPositionedEndpoints which are accessible via the givenRoute.java.util.Optional<E>getEndpoint(Route at)Returns the endpoint which exists at the givenRoute(if any).EgetOrAdd(Route route, java.util.function.Supplier<E> endpointFactory)java.util.Optional<RouteMatch<E>>route(Path path)default java.util.Optional<RouteMatch<E>>route(java.lang.String pathString)
-
-
-
Method Detail
-
route
default java.util.Optional<RouteMatch<E>> route(java.lang.String pathString)
-
route
java.util.Optional<RouteMatch<E>> route(Path path)
-
add
default void add(java.lang.String routeString, E endpoint) throws RouteConflictException- Throws:
RouteConflictException
-
add
void add(Route route, E endpoint) throws RouteConflictException
- Throws:
RouteConflictException
-
getAllEndpoints
java.util.Set<PositionedEndpoint<E>> getAllEndpoints(Route prefix)
Returns a set ofPositionedEndpoints which are accessible via the givenRoute. The returned collection includes the endpoints defined on the givenRouteas well as all endpoints which exists on routes that descend from the givenRoute.
-
getEndpoint
java.util.Optional<E> getEndpoint(Route at)
Returns the endpoint which exists at the givenRoute(if any).
-
add
default void add(PositionedEndpoint<E> positionedEndpoint)
- Throws:
RouteConflictException- if the given endpoint conflicts with a pre-existing endpoint within the router.
-
-