public class PersistentEntityResourceAssembler extends Object implements org.springframework.hateoas.ResourceAssembler<Object,PersistentEntityResource>
ResourceAssembler
to create PersistentEntityResource
s for arbitrary domain objects.Constructor and Description |
---|
PersistentEntityResourceAssembler(PersistentEntities entities,
org.springframework.hateoas.EntityLinks entityLinks,
Projector projector,
ResourceMappings mappings)
Creates a new
PersistentEntityResourceAssembler . |
Modifier and Type | Method and Description |
---|---|
org.springframework.hateoas.Link |
getSelfLinkFor(Object instance)
Creates the self link for the given domain instance.
|
PersistentEntityResource |
toFullResource(Object instance)
Returns the full object as
PersistentEntityResource using the underlying Projector . |
PersistentEntityResource |
toResource(Object instance) |
public PersistentEntityResourceAssembler(PersistentEntities entities, org.springframework.hateoas.EntityLinks entityLinks, Projector projector, ResourceMappings mappings)
PersistentEntityResourceAssembler
.entities
- must not be null.entityLinks
- must not be null.projector
- must not be null.mappings
- must not be null.public PersistentEntityResource toResource(Object instance)
toResource
in interface org.springframework.hateoas.ResourceAssembler<Object,PersistentEntityResource>
public PersistentEntityResource toFullResource(Object instance)
PersistentEntityResource
using the underlying Projector
.instance
- must not be null.public org.springframework.hateoas.Link getSelfLinkFor(Object instance)
instance
- must be a managed entity, not null.Copyright © 2011-2015–2015 Pivotal Software, Inc.. All rights reserved.