Class Traverson.TraversalBuilder
java.lang.Object
org.springframework.hateoas.client.Traverson.TraversalBuilder
- Enclosing class:
- Traverson
Builder API to customize traversals.
- Author:
- Oliver Gierke
-
Method Summary
Modifier and TypeMethodDescriptionasLink()
Returns theLink
found for the last rel in the rels configured to follow.Returns the templatedLink
found for the last relation in the rels configured to follow.Follows the given rels one by one, which means a request per rel to discover the next resource with the rel in line.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>
Returns the rawResponseEntity
with the representation unmarshalled into an instance of the given type.<T> T
Executes the traversal and marshals the final response into an object of the given type.<T> T
Executes the traversal and returns the result of the given JSON Path expression evaluated against the final representation.<T> T
toObject
(ParameterizedTypeReference<T> type) Executes the traversal and marshals the final response into an object of the givenParameterizedTypeReference
.withHeaders
(HttpHeaders headers) TheHttpHeaders
that shall be used for the requests of the traversal.withTemplateParameters
(Map<String, Object> parameters) Adds the given operations parameters to the traversal.
-
Method Details
-
follow
Follows the given rels one by one, which means a request per rel to discover the next resource with the rel in line.- Parameters:
rels
- must not be null.- Returns:
-
follow
Follows the given rels one by one, which means a request per rel to discover the next resource with the rel in line.- Parameters:
hop
- must not be null.- Returns:
- See Also:
-
withTemplateParameters
Adds the given operations parameters to the traversal. If a link discovered by the traversal is templated, the given parameters will be used to expand the operations into a resolvable URI.- Parameters:
parameters
- can be null.- Returns:
-
withHeaders
TheHttpHeaders
that shall be used for the requests of the traversal.- Parameters:
headers
- can be null.- Returns:
-
toObject
Executes the traversal and marshals the final response into an object of the given type.- Parameters:
type
- must not be null.- Returns:
-
toObject
Executes the traversal and marshals the final response into an object of the givenParameterizedTypeReference
.- Parameters:
type
- must not be null.- Returns:
-
toObject
Executes the traversal and returns the result of the given JSON Path expression evaluated against the final representation.- Parameters:
jsonPath
- must not be null or empty.- Returns:
-
toEntity
Returns the rawResponseEntity
with the representation unmarshalled into an instance of the given type.- Parameters:
type
- must not be null.- Returns:
-
asLink
Returns theLink
found for the last rel in the rels configured to follow. Will expand the finalLink
using the- Returns:
- Since:
- 0.15
- See Also:
-
asTemplatedLink
Returns the templatedLink
found for the last relation in the rels configured to follow.- Returns:
- Since:
- 0.17
-