Package com.duncpro.jroute.util
Class DelegatingRouter<E>
- java.lang.Object
-
- com.duncpro.jroute.util.DelegatingRouter<E>
-
- All Implemented Interfaces:
Router<E>
- Direct Known Subclasses:
RestRouter
public abstract class DelegatingRouter<E> extends java.lang.Object implements Router<E>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDelegatingRouter(Router<E> underlyingRouter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Route route, 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)
-
-
-
Method Detail
-
route
public java.util.Optional<RouteMatch<E>> route(Path path)
-
add
public void add(Route route, E endpoint) throws RouteConflictException
- Specified by:
addin interfaceRouter<E>- Throws:
RouteConflictException
-
getAllEndpoints
public java.util.Set<PositionedEndpoint<E>> getAllEndpoints(Route prefix)
Description copied from interface:RouterReturns 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.- Specified by:
getAllEndpointsin interfaceRouter<E>
-
-