public abstract class IdentifiableResourceAssemblerSupport<T extends Identifiable<?>,D extends ResourceSupport> extends ResourceAssemblerSupport<T,D>
ResourceAssembler
s. Will automate ResourceSupport
instance creation and make
sure a self-link is always added.Constructor and Description |
---|
IdentifiableResourceAssemblerSupport(Class<?> controllerClass,
Class<D> resourceType)
Creates a new
ResourceAssemblerSupport using the given controller class and resource type. |
Modifier and Type | Method and Description |
---|---|
protected D |
createResource(T entity)
Creates a new resource and adds a self link to it consisting using the
Identifiable 's id. |
protected D |
createResource(T entity,
Object... parameters) |
protected D |
createResourceWithId(Object id,
T entity,
Object... parameters) |
createResourceWithId, instantiateResource, toResources
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toResource
public IdentifiableResourceAssemblerSupport(Class<?> controllerClass, Class<D> resourceType)
ResourceAssemblerSupport
using the given controller class and resource type.controllerClass
- must not be null.resourceType
- must not be null.protected D createResource(T entity)
Identifiable
's id.entity
- must not be null.protected D createResourceWithId(Object id, T entity, Object... parameters)
createResourceWithId
in class ResourceAssemblerSupport<T extends Identifiable<?>,D extends ResourceSupport>
Copyright © 2012-2016–2018 Pivotal, Inc.. All rights reserved.