org.springframework.boot.web.client

Class RootUriTemplateHandler

  • java.lang.Object
    • org.springframework.boot.web.client.RootUriTemplateHandler
  • All Implemented Interfaces:
    org.springframework.web.util.UriTemplateHandler


    public class RootUriTemplateHandler
    extends java.lang.Object
    implements org.springframework.web.util.UriTemplateHandler
    UriTemplateHandler to set the root for URI that starts with '/'.
    Since:
    1.4.0
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static RootUriTemplateHandler addTo(org.springframework.web.client.RestTemplate restTemplate, java.lang.String rootUri)
      Add a RootUriTemplateHandler instance to the given RestTemplate.
      java.net.URI expand(java.lang.String uriTemplate, java.util.Map<java.lang.String,?> uriVariables) 
      java.net.URI expand(java.lang.String uriTemplate, java.lang.Object... uriVariables) 
      java.lang.String getRootUri() 
      RootUriTemplateHandler withHandlerWrapper(java.util.function.Function<org.springframework.web.util.UriTemplateHandler,org.springframework.web.util.UriTemplateHandler> wrapper)
      Derives a new RootUriTemplateHandler from this one, wrapping its delegate {link UriTemplateHandler} by applying the given wrapper.
      • Methods inherited from class java.lang.Object

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

      • RootUriTemplateHandler

        protected RootUriTemplateHandler(org.springframework.web.util.UriTemplateHandler handler)
      • RootUriTemplateHandler

        public RootUriTemplateHandler(java.lang.String rootUri)
        Create a new RootUriTemplateHandler instance.
        Parameters:
        rootUri - the root URI to be used to prefix relative URLs
      • RootUriTemplateHandler

        public RootUriTemplateHandler(java.lang.String rootUri,
                                      org.springframework.web.util.UriTemplateHandler handler)
        Create a new RootUriTemplateHandler instance.
        Parameters:
        rootUri - the root URI to be used to prefix relative URLs
        handler - the delegate handler
    • Method Detail

      • expand

        public java.net.URI expand(java.lang.String uriTemplate,
                                   java.util.Map<java.lang.String,?> uriVariables)
        Specified by:
        expand in interface org.springframework.web.util.UriTemplateHandler
      • expand

        public java.net.URI expand(java.lang.String uriTemplate,
                                   java.lang.Object... uriVariables)
        Specified by:
        expand in interface org.springframework.web.util.UriTemplateHandler
      • getRootUri

        public java.lang.String getRootUri()
      • withHandlerWrapper

        public RootUriTemplateHandler withHandlerWrapper(java.util.function.Function<org.springframework.web.util.UriTemplateHandler,org.springframework.web.util.UriTemplateHandler> wrapper)
        Derives a new RootUriTemplateHandler from this one, wrapping its delegate {link UriTemplateHandler} by applying the given wrapper.
        Parameters:
        wrapper - the wrapper to apply to the delegate URI template handler
        Returns:
        the new handler
        Since:
        2.3.10
      • addTo

        public static RootUriTemplateHandler addTo(org.springframework.web.client.RestTemplate restTemplate,
                                                   java.lang.String rootUri)
        Add a RootUriTemplateHandler instance to the given RestTemplate.
        Parameters:
        restTemplate - the RestTemplate to add the handler to
        rootUri - the root URI
        Returns:
        the added RootUriTemplateHandler.