Class QueryValueClientArgumentRequestBinder
- java.lang.Object
-
- io.micronaut.http.client.bind.binders.QueryValueClientArgumentRequestBinder
-
- All Implemented Interfaces:
AnnotatedClientArgumentRequestBinder<io.micronaut.http.annotation.QueryValue>,ClientArgumentRequestBinder<java.lang.Object>,ClientRequestBinder
public class QueryValueClientArgumentRequestBinder extends java.lang.Object implements AnnotatedClientArgumentRequestBinder<io.micronaut.http.annotation.QueryValue>
Implementation of the Binder forQueryValueThe details of implementation can be found in thebind(ArgumentConversionContext, ClientRequestUriContext, Object, MutableHttpRequest)bind()} method javadoc.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description QueryValueClientArgumentRequestBinder(io.micronaut.core.convert.ConversionService<?> conversionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(io.micronaut.core.convert.ArgumentConversionContext<java.lang.Object> context, ClientRequestUriContext uriContext, java.lang.Object value, io.micronaut.http.MutableHttpRequest<?> request)If value can be converted to ConvertibleMultiValues, then use it and add it to the uriContext.queryParameters.java.lang.Class<io.micronaut.http.annotation.QueryValue>getAnnotationType()
-
-
-
Method Detail
-
getAnnotationType
@NonNull public java.lang.Class<io.micronaut.http.annotation.QueryValue> getAnnotationType()
- Specified by:
getAnnotationTypein interfaceAnnotatedClientArgumentRequestBinder<io.micronaut.http.annotation.QueryValue>- Returns:
- The annotation type.
-
bind
public void bind(@NonNull io.micronaut.core.convert.ArgumentConversionContext<java.lang.Object> context, @NonNull ClientRequestUriContext uriContext, @NonNull java.lang.Object value, @NonNull io.micronaut.http.MutableHttpRequest<?> request)If value can be converted to ConvertibleMultiValues, then use it and add it to the uriContext.queryParameters. The ConvertibleMultiValues converters are found inMultiValuesConverterFactoryand perform conversion only when theFormatannotation has one of the supported values. Otherwise if theFormatannotation is present, it is converted toString. If none of these are satisfied, theUriTemplatedecides what to do with the given value which is supplied as an Object (it is added to uriContext.pathParameter).
By default value is converted to ConvertibleMultiValues when theFormatannotation is present and has one of the defined above formats. Otherwise empty optional is returned.
The defaultUriTemplatewill convert the value to String and to parameters. Optionally, the value can be formatted if the path template states so.- Specified by:
bindin interfaceClientArgumentRequestBinder<java.lang.Object>- Parameters:
context- The argument contexturiContext- The URI contextvalue- The argument valuerequest- The request
-
-