Package io.micronaut.http.server.binding
Class RouteMatchArgumentBinder
java.lang.Object
io.micronaut.http.server.binding.RouteMatchArgumentBinder
- All Implemented Interfaces:
ArgumentBinder<RouteMatch<?>,
,HttpRequest<?>> TypeArgumentBinder<RouteMatch<?>,
,HttpRequest<?>> RequestArgumentBinder<RouteMatch<?>>
,TypedRequestArgumentBinder<RouteMatch<?>>
,FilterArgumentBinderPredicate
@Singleton
public final class RouteMatchArgumentBinder
extends Object
implements TypedRequestArgumentBinder<RouteMatch<?>>, FilterArgumentBinderPredicate
Argument binder for
RouteMatch
objects.- Since:
- 4.6.0
- Author:
- Jonas Konrad
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.core.bind.ArgumentBinder
ArgumentBinder.BindingResult<T>
-
Method Summary
Modifier and TypeMethodDescriptionArgument<RouteMatch<?>>
bind
(ArgumentConversionContext<RouteMatch<?>> context, HttpRequest<?> source) Bind the given argument from the given source.boolean
test
(Argument<?> argument, MutablePropagatedContext mutablePropagatedContext, HttpRequest<?> request, @Nullable HttpResponse<?> response, @Nullable Throwable failure) Check whether the filter method should run in the given context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.bind.binders.TypedRequestArgumentBinder
matches, superTypes
-
Method Details
-
argumentType
- Specified by:
argumentType
in interfaceTypeArgumentBinder<RouteMatch<?>,
HttpRequest<?>> - Returns:
- The argument type.
-
bind
public ArgumentBinder.BindingResult<RouteMatch<?>> bind(ArgumentConversionContext<RouteMatch<?>> context, HttpRequest<?> source) Description copied from interface:ArgumentBinder
Bind the given argument from the given source.- Specified by:
bind
in interfaceArgumentBinder<RouteMatch<?>,
HttpRequest<?>> - Parameters:
context
- TheArgumentConversionContext
source
- The source- Returns:
- An
Optional
of the value. If no binding was possibleOptional.empty()
-
test
public boolean test(Argument<?> argument, MutablePropagatedContext mutablePropagatedContext, HttpRequest<?> request, @Nullable @Nullable HttpResponse<?> response, @Nullable @Nullable Throwable failure) Description copied from interface:FilterArgumentBinderPredicate
Check whether the filter method should run in the given context.- Specified by:
test
in interfaceFilterArgumentBinderPredicate
- Parameters:
argument
- The argument that this binder bindsmutablePropagatedContext
- The propagated contextrequest
- The requestresponse
- For response filters, the response (if there is no failure)failure
- For response filters, the failure- Returns:
true
if this filter method should run
-