Package io.micronaut.http.bind.binders
Class CookieAnnotationBinder<T>
java.lang.Object
io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
io.micronaut.http.bind.binders.CookieAnnotationBinder<T>
- Type Parameters:
T
- A type
- All Implemented Interfaces:
AnnotatedArgumentBinder<CookieValue,
,T, HttpRequest<?>> ArgumentBinder<T,
,HttpRequest<?>> AnnotatedRequestArgumentBinder<CookieValue,
,T> RequestArgumentBinder<T>
public class CookieAnnotationBinder<T>
extends AbstractArgumentBinder<T>
implements AnnotatedRequestArgumentBinder<CookieValue,T>
An
AnnotatedArgumentBinder
implementation that uses the CookieValue
annotation to trigger binding from an HTTP Cookie
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.core.bind.ArgumentBinder
ArgumentBinder.BindingResult<T>
-
Field Summary
Fields inherited from class io.micronaut.core.bind.annotation.AbstractArgumentBinder
conversionService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbind
(ArgumentConversionContext<T> argument, HttpRequest<?> source) Bind the given argument from the given source.protected String
getFallbackFormat
(Argument<?> argument)
-
Constructor Details
-
CookieAnnotationBinder
- Parameters:
conversionService
- The conversion service
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationType
in interfaceAnnotatedArgumentBinder<CookieValue,
T, HttpRequest<?>> - Returns:
- The annotation type.
-
bind
public ArgumentBinder.BindingResult<T> bind(ArgumentConversionContext<T> argument, HttpRequest<?> source) Description copied from interface:ArgumentBinder
Bind the given argument from the given source.- Specified by:
bind
in interfaceArgumentBinder<T,
HttpRequest<?>> - Parameters:
argument
- TheArgumentConversionContext
source
- The source- Returns:
- An
Optional
of the value. If no binding was possibleOptional.empty()
-
getFallbackFormat
- Overrides:
getFallbackFormat
in classAbstractArgumentBinder<T>
- Parameters:
argument
- The argument- Returns:
- The fallback format
-