I'm using spring-hateoas:0.18.0.RELEASE with spring-boot:1.2.5.RELEASE
For calling my Web Service and going through HAL links i'm using Traverson Client (API for client side service traversal inspired by the Traverson JavaScript library)
Spring Hateoas Traverson Documentation
It's new for working with Hypermedia and HateoasRest
My question is when do I need to use PagedResources and Resource?
Example I found here Traverson Client examples :
final PagedResources<Resource<Customer>> resources = traverson
.follow("customers","search","findByFirstName")
.withTemplateParameters(parameters)
.toObject(new TypeReferences.PagedResourcesType<Resource<Customer>>(){});
The code I wrote is :
ParameterizedTypeReference<Resource<ProjectJSON>> resourceParameterizedTypeReference = new
ParameterizedTypeReference<Resource<ProjectJSON>>() {};
Resource<ProjectJSON> projectJSONResource = traverson
.follow("projects")
.follow("$._embedded.projects[0]._links.self.href")
.toObject(resourceParameterizedTypeReference);
I know it's not the same thing, but what is the best practice with resources when calling Traverson.toObject() method?