public class Traverson extends Object
https://github.com/basti1302/traverson
Modifier and Type | Class and Description |
---|---|
class |
Traverson.TraversalBuilder
Builder API to customize traversals.
|
Constructor and Description |
---|
Traverson(URI baseUri,
List<org.springframework.http.MediaType> mediaTypes)
Creates a new
Traverson interacting with the given base URI and using the given MediaType s to
interact with the service. |
Traverson(URI baseUri,
org.springframework.http.MediaType... mediaTypes)
Creates a new
Traverson interacting with the given base URI and using the given MediaType s to
interact with the service. |
Modifier and Type | Method and Description |
---|---|
Traverson.TraversalBuilder |
follow(Hop hop)
Sets up a
Traverson.TraversalBuilder for a single rel with customized details. |
Traverson.TraversalBuilder |
follow(String... rels)
Sets up a
Traverson.TraversalBuilder to follow the given rels. |
static List<org.springframework.http.converter.HttpMessageConverter<?>> |
getDefaultMessageConverters(org.springframework.http.MediaType... mediaTypes)
Returns all
HttpMessageConverter s that will be registered for the given MediaType s by default. |
Traverson |
setLinkDiscoverers(List<? extends LinkDiscoverer> discoverer)
Sets the
LinkDiscoverers to use. |
Traverson |
setRestOperations(org.springframework.web.client.RestOperations operations)
Configures the
RestOperations to use. |
public Traverson(URI baseUri, org.springframework.http.MediaType... mediaTypes)
Traverson
interacting with the given base URI and using the given MediaType
s to
interact with the service.baseUri
- must not be null.mediaTypes
- must not be null or empty.public static List<org.springframework.http.converter.HttpMessageConverter<?>> getDefaultMessageConverters(org.springframework.http.MediaType... mediaTypes)
HttpMessageConverter
s that will be registered for the given MediaType
s by default.mediaTypes
- must not be null.public Traverson setRestOperations(org.springframework.web.client.RestOperations operations)
RestOperations
to use. If null is provided a default RestTemplate
will be
used.operations
- public Traverson setLinkDiscoverers(List<? extends LinkDiscoverer> discoverer)
LinkDiscoverers
to use. By default a single HalLinkDiscoverer
is registered. If
null is provided the default is reapplied.discoverer
- can be null.public Traverson.TraversalBuilder follow(String... rels)
Traverson.TraversalBuilder
to follow the given rels.rels
- must not be null or empty.Traverson.TraversalBuilder
public Traverson.TraversalBuilder follow(Hop hop)
Traverson.TraversalBuilder
for a single rel with customized details.hop
- must not be nullCopyright © 2012-2019–2019 Pivotal, Inc.. All rights reserved.