Package org.forgerock.services.routing
Class RouteMatcher<R>
java.lang.Object
org.forgerock.services.routing.RouteMatcher<R>
- Type Parameters:
R
- The type of the request.
- Direct Known Subclasses:
DelegatingRouteMatcher
A matcher for evaluating whether a route matches the incoming request.
Implementing class can either return a
RouteMatch
, if the route
matches, or null
, if the route does not match, from the
evaluate(Context, Object)
method.
Implementing classes must implement both equals(Object)
and
hashCode()
methods as each instance of a RouteMatcher
will be used as the key for a route.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
abstract RouteMatch
Evaluates the request and determines whether it matches the route.abstract int
hashCode()
abstract String
The fragment of an API ID that this matcher provides.abstract String
toString()
Returns aString
representation of the route matcher.abstract <D> D
transformApi
(D descriptor, ApiProducer<D> producer) Transform the API Descriptor as appropriate for the parent router's view of the child routes.
-
Constructor Details
-
RouteMatcher
public RouteMatcher()
-
-
Method Details
-
evaluate
Evaluates the request and determines whether it matches the route.- Parameters:
context
- The request context.request
- The request.- Returns:
- A
RouteMatch
, if the request matches the route, ornull
, if not.
-
toString
Returns aString
representation of the route matcher. -
idFragment
The fragment of an API ID that this matcher provides.- Returns:
- A fragment of the API ID.
-
hashCode
public abstract int hashCode() -
equals
-
transformApi
Transform the API Descriptor as appropriate for the parent router's view of the child routes.- Type Parameters:
D
- The type of descriptor object.- Parameters:
descriptor
- The descriptor to be mutated.producer
- The API Descriptor producer.- Returns:
- The new descriptor object.
-