Package io.micronaut.http.client.bind
Class ClientRequestUriContext
- java.lang.Object
-
- io.micronaut.http.client.bind.ClientRequestUriContext
-
public class ClientRequestUriContext extends java.lang.ObjectA class that exposes information about the URI toClientArgumentRequestBinderinstances. The binders can mutate the path and query parameters to allow control over the resulting URI.- Since:
- 2.1.0
-
-
Constructor Summary
Constructors Constructor Description ClientRequestUriContext(io.micronaut.http.uri.UriMatchTemplate uriTemplate, java.util.Map<java.lang.String,java.lang.Object> pathParameters, java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddQueryParameter(java.lang.String name, java.lang.String value)Add a new query parameter given its name.java.util.Map<java.lang.String,java.lang.Object>getPathParameters()java.util.Map<java.lang.String,java.util.List<java.lang.String>>getQueryParameters()io.micronaut.http.uri.UriMatchTemplategetUriTemplate()voidsetPathParameter(java.lang.String name, java.lang.Object value)Set the value of a path parameter.voidsetQueryParameter(java.lang.String name, java.util.List<java.lang.String> values)Set all the values of query parameters.
-
-
-
Method Detail
-
getUriTemplate
public io.micronaut.http.uri.UriMatchTemplate getUriTemplate()
- Returns:
- The URI template for the client method
-
getPathParameters
public java.util.Map<java.lang.String,java.lang.Object> getPathParameters()
- Returns:
- The parameters used to expand the URI template.
- See Also:
UriTemplate.expand(Map)
-
getQueryParameters
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getQueryParameters()
- Returns:
- The parameters to be appended to the URI template as query parameters
-
addQueryParameter
public void addQueryParameter(java.lang.String name, java.lang.String value)Add a new query parameter given its name. If parameter with name already exists, the parameter will be duplicated in query.- Parameters:
name- - the name of the parametervalue- - that value to add
-
setQueryParameter
public void setQueryParameter(java.lang.String name, java.util.List<java.lang.String> values)Set all the values of query parameters.- Parameters:
name- - the name of the parametervalues- - all the values of the parameter
-
setPathParameter
public void setPathParameter(java.lang.String name, java.lang.Object value)Set the value of a path parameter.- Parameters:
name- - the name of the parametervalue- - the value of the parameter
-
-