public class RootUriTemplateHandler extends Object implements UriTemplateHandler
UriTemplateHandler
to set the root for URI that starts with '/'
.Modifier | Constructor and Description |
---|---|
|
RootUriTemplateHandler(String rootUri)
Create a new
RootUriTemplateHandler instance. |
|
RootUriTemplateHandler(String rootUri,
UriTemplateHandler handler)
Create a new
RootUriTemplateHandler instance. |
protected |
RootUriTemplateHandler(UriTemplateHandler handler) |
Modifier and Type | Method and Description |
---|---|
static RootUriTemplateHandler |
addTo(RestTemplate restTemplate,
String rootUri)
Add a
RootUriTemplateHandler instance to the given RestTemplate . |
URI |
expand(String uriTemplate,
Map<String,?> uriVariables) |
URI |
expand(String uriTemplate,
Object... uriVariables) |
String |
getRootUri() |
RootUriTemplateHandler |
withHandlerWrapper(Function<UriTemplateHandler,UriTemplateHandler> wrapper)
Derives a new
RootUriTemplateHandler from this one, wrapping its delegate
{link UriTemplateHandler} by applying the given wrapper . |
protected RootUriTemplateHandler(UriTemplateHandler handler)
public RootUriTemplateHandler(String rootUri)
RootUriTemplateHandler
instance.rootUri
- the root URI to be used to prefix relative URLspublic RootUriTemplateHandler(String rootUri, UriTemplateHandler handler)
RootUriTemplateHandler
instance.rootUri
- the root URI to be used to prefix relative URLshandler
- the delegate handlerpublic URI expand(String uriTemplate, Map<String,?> uriVariables)
expand
in interface UriTemplateHandler
public URI expand(String uriTemplate, Object... uriVariables)
expand
in interface UriTemplateHandler
public String getRootUri()
public RootUriTemplateHandler withHandlerWrapper(Function<UriTemplateHandler,UriTemplateHandler> wrapper)
RootUriTemplateHandler
from this one, wrapping its delegate
{link UriTemplateHandler} by applying the given wrapper
.wrapper
- the wrapper to apply to the delegate URI template handlerpublic static RootUriTemplateHandler addTo(RestTemplate restTemplate, String rootUri)
RootUriTemplateHandler
instance to the given RestTemplate
.restTemplate
- the RestTemplate
to add the handler torootUri
- the root URIRootUriTemplateHandler
.