Package io.micronaut.http.client.bind
Class DefaultHttpClientBinderRegistry
java.lang.Object
io.micronaut.http.client.bind.DefaultHttpClientBinderRegistry
- All Implemented Interfaces:
HttpClientBinderRegistry
@Singleton
@Internal
public class DefaultHttpClientBinderRegistry
extends Object
implements HttpClientBinderRegistry
Default implementation of
HttpClientBinderRegistry
that searches by
annotation then by type.- Since:
- 2.1.0
- Author:
- James Kleeh
-
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultHttpClientBinderRegistry
(ConversionService conversionService, List<ClientRequestBinder> binders, BeanContext beanContext) -
Method Summary
Modifier and TypeMethodDescription<T> void
addBinder
(ClientRequestBinder binder) Adds a binder to the registry.findAnnotatedBinder
(@NonNull Class<?> annotationType) Locate anAnnotatedClientRequestBinder
for a given annotation type (that is supposed to be applied to the method).<T> Optional<ClientArgumentRequestBinder<?>>
findArgumentBinder
(@NonNull Argument<T> argument) Locate anClientArgumentRequestBinder
for the given argument.
-
Constructor Details
-
DefaultHttpClientBinderRegistry
protected DefaultHttpClientBinderRegistry(ConversionService conversionService, List<ClientRequestBinder> binders, BeanContext beanContext) - Parameters:
conversionService
- The conversion servicebinders
- The request bindersbeanContext
- The context to resolve beans
-
-
Method Details
-
findArgumentBinder
public <T> Optional<ClientArgumentRequestBinder<?>> findArgumentBinder(@NonNull @NonNull Argument<T> argument) Description copied from interface:HttpClientBinderRegistry
Locate anClientArgumentRequestBinder
for the given argument.- Specified by:
findArgumentBinder
in interfaceHttpClientBinderRegistry
- Type Parameters:
T
- The argument type- Parameters:
argument
- The argument- Returns:
- An
Optional
ofClientArgumentRequestBinder
-
findAnnotatedBinder
public Optional<AnnotatedClientRequestBinder<?>> findAnnotatedBinder(@NonNull @NonNull Class<?> annotationType) Description copied from interface:HttpClientBinderRegistry
Locate anAnnotatedClientRequestBinder
for a given annotation type (that is supposed to be applied to the method).- Specified by:
findAnnotatedBinder
in interfaceHttpClientBinderRegistry
- Parameters:
annotationType
- - the type of annotation- Returns:
- An
Optional
ofAnnotatedClientRequestBinder
-
addBinder
Adds a binder to the registry.- Type Parameters:
T
- The type- Parameters:
binder
- The binder
-