public class SimpleResourceAssembler<T> extends Object implements org.springframework.hateoas.ResourceAssembler<T,org.springframework.hateoas.Resource<T>>, ResourcesAssembler<T,org.springframework.hateoas.Resource<T>>
ResourceAssembler/ResourcesAssembler that focuses purely on the domain type,
returning back Resource and Resources for that type instead of
ResourceSupport.| Constructor and Description |
|---|
SimpleResourceAssembler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLinks(org.springframework.hateoas.Resource<T> resource)
Define links to add to every individual
Resource. |
protected void |
addLinks(org.springframework.hateoas.Resources<org.springframework.hateoas.Resource<T>> resources)
Define links to add to the
Resources collection. |
org.springframework.hateoas.Resource<T> |
toResource(T entity)
Converts the given entity into a
Resource. |
org.springframework.hateoas.Resources<org.springframework.hateoas.Resource<T>> |
toResources(Iterable<? extends T> entities)
Converts all given entities into resources and wraps the collection as a resource as well.
|
public org.springframework.hateoas.Resource<T> toResource(T entity)
Resource.public org.springframework.hateoas.Resources<org.springframework.hateoas.Resource<T>> toResources(Iterable<? extends T> entities)
toResources in interface ResourcesAssembler<T,org.springframework.hateoas.Resource<T>>entities - must not be null.Resources containing Resource of T.toResource(Object)protected void addLinks(org.springframework.hateoas.Resource<T> resource)
Resource.resource - protected void addLinks(org.springframework.hateoas.Resources<org.springframework.hateoas.Resource<T>> resources)
Resources collection.resources - Copyright © 2018 Pivotal Software, Inc.. All rights reserved.