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 theLinkfound for the last rel in the rels configured to follow.Returns the templatedLinkfound 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> org.springframework.http.ResponseEntity<T>Returns the rawResponseEntitywith the representation unmarshalled into an instance of the given type.<T> @Nullable TExecutes the traversal and marshals the final response into an object of the given type.<T> TExecutes the traversal and returns the result of the given JSON Path expression evaluated against the final representation.<T> @Nullable TtoObject(org.springframework.core.ParameterizedTypeReference<T> type) Executes the traversal and marshals the final response into an object of the givenParameterizedTypeReference.withHeaders(org.springframework.http.HttpHeaders headers) TheHttpHeadersthat 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
TheHttpHeadersthat 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
public <T> @Nullable T toObject(org.springframework.core.ParameterizedTypeReference<T> type) 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 rawResponseEntitywith the representation unmarshalled into an instance of the given type.- Parameters:
type- must not be null.- Returns:
-
asLink
Returns theLinkfound for the last rel in the rels configured to follow. Will expand the finalLinkusing the- Returns:
- Since:
- 0.15
- See Also:
-
asTemplatedLink
Returns the templatedLinkfound for the last relation in the rels configured to follow.- Returns:
- Since:
- 0.17
-