- Type Parameters:
A- the resource type
- All Known Subinterfaces:
AcceptContentRoute<A>,AcceptLanguageRoute<A>,AuthorityRoute<A>,ContentRoute<A>,ErrorRoute<A>,HeadersRoute<A>,MethodRoute<A>,PathRoute<A>,QueryParametersRoute<A>,URIRoute<A>,WebSocketSubprotocolRoute<A>
- All Known Implementing Classes:
AbstractRoute
public interface Route<A>
A route defines the path to a resource in a router.
It is defined in a Router using a RouteManager and used to resolve the resource corresponding to particular input.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Disables the route in the router.voidenable()Enables the route in the router.get()Returns the resource defined on the route.default AMerges the route resource with the value that was previously defined in the router.booleanDetermines whether the route is disabled in the router.voidremove()Removes the route from the router.
-
Method Details
-
get
A get()Returns the resource defined on the route.
- Returns:
- a resource
-
get
Merges the route resource with the value that was previously defined in the router.
Implementors can override this method to control how a route is set in a router when a resource has already been defined for the route. The default behaviour is to replace the existing value with the new one.
- Parameters:
previous- the resource value previously defined in the router or null if no resource was defined for the route- Returns:
- the merged resource
-
enable
void enable()Enables the route in the router.
-
disable
void disable()Disables the route in the router.
-
isDisabled
boolean isDisabled()Determines whether the route is disabled in the router.
- Returns:
- true if the route is disabled, false otherwise
-
remove
void remove()Removes the route from the router.
-