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<MediaType> mediaTypes)
|
Traverson(URI baseUri,
MediaType... mediaTypes)
|
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<HttpMessageConverter<?>> |
getDefaultMessageConverters(List<MediaType> mediaTypes)
Returns all
HttpMessageConverter s that will be registered for the given MediaType s by default. |
static List<HttpMessageConverter<?>> |
getDefaultMessageConverters(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(RestOperations operations)
Configures the
RestOperations to use. |
public Traverson(URI baseUri, 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<HttpMessageConverter<?>> getDefaultMessageConverters(MediaType... mediaTypes)
HttpMessageConverter
s that will be registered for the given MediaType
s by default.mediaTypes
- must not be null.public static List<HttpMessageConverter<?>> getDefaultMessageConverters(List<MediaType> mediaTypes)
HttpMessageConverter
s that will be registered for the given MediaType
s by default.mediaTypes
- must not be null.public Traverson setRestOperations(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-2016–2018 Pivotal, Inc.. All rights reserved.