Class QueryValueClientArgumentRequestBinder
java.lang.Object
io.micronaut.http.client.bind.binders.QueryValueClientArgumentRequestBinder
- All Implemented Interfaces:
AnnotatedClientArgumentRequestBinder<QueryValue>
,ClientArgumentRequestBinder<Object>
,ClientRequestBinder
public class QueryValueClientArgumentRequestBinder
extends Object
implements AnnotatedClientArgumentRequestBinder<QueryValue>
Implementation of the Binder for
QueryValue
The details of implementation can be found in the
bind(ArgumentConversionContext, ClientRequestUriContext, Object, MutableHttpRequest)
method javadoc.- Since:
- 3.0.0
- Author:
- Andriy Dmytruk
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(@NonNull ArgumentConversionContext<Object> context, @NonNull ClientRequestUriContext uriContext, @NonNull Object value, @NonNull MutableHttpRequest<?> request) If value can be converted to ConvertibleMultiValues, then use it and add it to the uriContext.queryParameters.
-
Constructor Details
-
QueryValueClientArgumentRequestBinder
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationType
in interfaceAnnotatedClientArgumentRequestBinder<QueryValue>
- Returns:
- The annotation type.
-
bind
public void bind(@NonNull @NonNull ArgumentConversionContext<Object> context, @NonNull @NonNull ClientRequestUriContext uriContext, @NonNull @NonNull Object value, @NonNull @NonNull MutableHttpRequest<?> request) If value can be converted to ConvertibleMultiValues, then use it and add it to the uriContext.queryParameters. The ConvertibleMultiValues converters are found inMultiValuesConverterFactory
and perform conversion only when theFormat
annotation has one of the supported values. Otherwise, if theFormat
annotation is present, it is converted toString
. If none of these are satisfied, theUriTemplate
decides 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 theFormat
annotation is present and has one of the defined above formats. Otherwise, empty optional is returned.
The defaultUriTemplate
will convert the value to String and to parameters. Optionally, the value can be formatted if the path template states so.- Specified by:
bind
in interfaceClientArgumentRequestBinder<Object>
- Parameters:
context
- The argument contexturiContext
- The URI contextvalue
- The argument valuerequest
- The request
-