Class ClientRequestUriContext


  • public class ClientRequestUriContext
    extends java.lang.Object
    A class that exposes information about the URI to ClientArgumentRequestBinder instances. 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
      void addQueryParameter​(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.UriMatchTemplate getUriTemplate()  
      void setPathParameter​(java.lang.String name, java.lang.Object value)
      Set the value of a path parameter.
      void setQueryParameter​(java.lang.String name, java.util.List<java.lang.String> values)
      Set all the values of query parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClientRequestUriContext

        @Internal
        public 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 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 parameter
        value - - 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 parameter
        values - - 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 parameter
        value - - the value of the parameter