Spring Hateoas

org.springframework.hateoas.client
Class Traverson.TraversalBuilder

java.lang.Object
  extended by org.springframework.hateoas.client.Traverson.TraversalBuilder
Enclosing class:
Traverson

public class Traverson.TraversalBuilder
extends Object

Builder API to customize traversals.

Author:
Oliver Gierke

Method Summary
<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 template parameters to the traversal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withTemplateParameters

public Traverson.TraversalBuilder withTemplateParameters(Map<String,Object> parameters)
Adds the given template parameters to the traversal. If a link discovered by the traversal is templated, the given parameters will be used to expand the template into a resolvable URI.

Parameters:
parameters - can be null.
Returns:

withHeaders

public Traverson.TraversalBuilder withHeaders(HttpHeaders headers)
The HttpHeaders that shall be used for the requests of the traversal.

Parameters:
headers - can be null.
Returns:

toObject

public <T> T toObject(Class<T> type)
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> T toObject(ParameterizedTypeReference<T> type)
Executes the traversal and marshals the final response into an object of the given ParameterizedTypeReference.

Parameters:
type - must not be null.
Returns:

toObject

public <T> T toObject(String jsonPath)
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

public <T> ResponseEntity<T> toEntity(Class<T> type)
Returns the raw ResponseEntity with the representation unmarshalled into an instance of the given type.

Parameters:
type - must not be null.
Returns:

Spring Hateoas

Copyright © 2012-2014-2014 Pivotal, Inc.. All Rights Reserved.