Modifier and Type | Method and Description |
---|---|
Link |
asLink()
Returns the
Link found for the last rel in the rels configured to follow. |
Link |
asTemplatedLink()
Returns the templated
Link found for the last rel in the rels configured to follow. |
Traverson.TraversalBuilder |
follow(Hop hop)
Follows the given rels one by one, which means a request per rel to discover the next resource with the rel in
line.
|
Traverson.TraversalBuilder |
follow(String... rels)
Follows the given rels one by one, which means a request per rel to discover the next resource with the rel in
line.
|
<T> ResponseEntity<T> |
toEntity(Class<T> type)
Returns the raw
ResponseEntity with the representation unmarshalled into an instance of the given type. |
<T> T |
toObject(Class<T> type)
Executes the traversal and marshals the final response into an object of the given type.
|
<T> T |
toObject(ParameterizedTypeReference<T> type)
Executes the traversal and marshals the final response into an object of the given
ParameterizedTypeReference . |
<T> T |
toObject(String jsonPath)
Executes the traversal and returns the result of the given JSON Path expression evaluated against the final
representation.
|
Traverson.TraversalBuilder |
withHeaders(HttpHeaders headers)
The
HttpHeaders that shall be used for the requests of the traversal. |
Traverson.TraversalBuilder |
withTemplateParameters(Map<String,Object> parameters)
Adds the given operations parameters to the traversal.
|
public Traverson.TraversalBuilder follow(String... rels)
rels
- must not be null.public Traverson.TraversalBuilder follow(Hop hop)
hop
- must not be null.Hop.rel(String)
public Traverson.TraversalBuilder withTemplateParameters(Map<String,Object> parameters)
parameters
- can be null.public Traverson.TraversalBuilder withHeaders(HttpHeaders headers)
HttpHeaders
that shall be used for the requests of the traversal.headers
- can be null.public <T> T toObject(Class<T> type)
type
- must not be null.public <T> T toObject(ParameterizedTypeReference<T> type)
ParameterizedTypeReference
.type
- must not be null.public <T> T toObject(String jsonPath)
jsonPath
- must not be null or empty.public <T> ResponseEntity<T> toEntity(Class<T> type)
ResponseEntity
with the representation unmarshalled into an instance of the given type.type
- must not be null.public Link asLink()
Link
found for the last rel in the rels configured to follow. Will expand the final
Link
using thewithTemplateParameters(Map)
Copyright © 2012-2016–2018 Pivotal, Inc.. All rights reserved.