Package org.forgerock.services.routing
Class DelegatingRouteMatcher<R>
- java.lang.Object
-
- org.forgerock.services.routing.RouteMatcher<R>
-
- org.forgerock.services.routing.DelegatingRouteMatcher<R>
-
- Type Parameters:
R
- The type or request being matched.
public class DelegatingRouteMatcher<R> extends RouteMatcher<R>
A route matcher that delegates to a provided route matcher.
-
-
Constructor Summary
Constructors Constructor Description DelegatingRouteMatcher(RouteMatcher<R> delegate)
Create a new route matcher, delegating to the provided delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
RouteMatch
evaluate(Context context, R request)
Evaluates the request and determines whether it matches the route.int
hashCode()
String
idFragment()
The fragment of an API ID that this matcher provides.String
toString()
Returns aString
representation of the route matcher.<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 Detail
-
DelegatingRouteMatcher
public DelegatingRouteMatcher(RouteMatcher<R> delegate)
Create a new route matcher, delegating to the provided delegate.- Parameters:
delegate
- The delegate.
-
-
Method Detail
-
evaluate
public RouteMatch evaluate(Context context, R request)
Description copied from class:RouteMatcher
Evaluates the request and determines whether it matches the route.- Specified by:
evaluate
in classRouteMatcher<R>
- Parameters:
context
- The request context.request
- The request.- Returns:
- A
RouteMatch
, if the request matches the route, ornull
, if not.
-
toString
public String toString()
Description copied from class:RouteMatcher
Returns aString
representation of the route matcher.- Specified by:
toString
in classRouteMatcher<R>
- Returns:
- A string representation of the route matcher.
-
idFragment
public String idFragment()
Description copied from class:RouteMatcher
The fragment of an API ID that this matcher provides.- Specified by:
idFragment
in classRouteMatcher<R>
- Returns:
- A fragment of the API ID.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classRouteMatcher<R>
-
equals
public boolean equals(Object o)
- Specified by:
equals
in classRouteMatcher<R>
-
transformApi
public <D> D transformApi(D descriptor, ApiProducer<D> producer)
Description copied from class:RouteMatcher
Transform the API Descriptor as appropriate for the parent router's view of the child routes.- Specified by:
transformApi
in classRouteMatcher<R>
- 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.
-
-