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
ConstructorsModifierConstructorDescriptionprotectedDefaultHttpClientBinderRegistry(ConversionService conversionService, List<ClientRequestBinder> binders, BeanContext beanContext) -
Method Summary
Modifier and TypeMethodDescription<T> voidaddBinder(ClientRequestBinder binder) Adds a binder to the registry.findAnnotatedBinder(@NonNull Class<?> annotationType) Locate anAnnotatedClientRequestBinderfor a given annotation type (that is supposed to be applied to the method).<T> Optional<ClientArgumentRequestBinder<?>>findArgumentBinder(@NonNull Argument<T> argument) Locate anClientArgumentRequestBinderfor 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:HttpClientBinderRegistryLocate anClientArgumentRequestBinderfor the given argument.- Specified by:
findArgumentBinderin interfaceHttpClientBinderRegistry- Type Parameters:
T- The argument type- Parameters:
argument- The argument- Returns:
- An
OptionalofClientArgumentRequestBinder
-
findAnnotatedBinder
public Optional<AnnotatedClientRequestBinder<?>> findAnnotatedBinder(@NonNull @NonNull Class<?> annotationType) Description copied from interface:HttpClientBinderRegistryLocate anAnnotatedClientRequestBinderfor a given annotation type (that is supposed to be applied to the method).- Specified by:
findAnnotatedBinderin interfaceHttpClientBinderRegistry- Parameters:
annotationType- - the type of annotation- Returns:
- An
OptionalofAnnotatedClientRequestBinder
-
addBinder
Adds a binder to the registry.- Type Parameters:
T- The type- Parameters:
binder- The binder
-