org.springframework.hateoas.core
Class AbstractEntityLinks
java.lang.Object
org.springframework.hateoas.core.AbstractEntityLinks
- All Implemented Interfaces:
- EntityLinks, org.springframework.plugin.core.Plugin<Class<?>>
- Direct Known Subclasses:
- ControllerEntityLinks, DelegatingEntityLinks
public abstract class AbstractEntityLinks
- extends Object
- implements EntityLinks
Implementation base class to delegate the higher level methods of EntityLinks by delegating to the more fine
grained ones to reduce the implementation effort for actual implementation classes.
- Author:
- Oliver Gierke
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.plugin.core.Plugin |
supports |
AbstractEntityLinks
public AbstractEntityLinks()
linkToSingleResource
public Link linkToSingleResource(Identifiable<?> entity)
- Description copied from interface:
EntityLinks
- Creates a
Link pointing to single resource backing the given entity. The relation type of the link will be
determined by the implementation class and should be defaulted to Link.REL_SELF.
- Specified by:
linkToSingleResource in interface EntityLinks
- Parameters:
entity - the entity type to point to, must not be null.
- Returns:
- the
Link pointing to the resource exposed for the given entity. Will never be null.
linkForSingleResource
public LinkBuilder linkForSingleResource(Class<?> type,
Object id)
- Description copied from interface:
EntityLinks
- Returns a
LinkBuilder able to create links to the controller managing the given entity type and id.
Implementations will know about the URI structure being used to expose single-resource URIs.
- Specified by:
linkForSingleResource in interface EntityLinks
- Parameters:
type - the entity type to point to, must not be null.id - the id of the object of the handed type, Identifiables will be unwrapped.
- Returns:
- the
LinkBuilder pointing to the single resource identified by the given type and id. Will never be
null.
linkForSingleResource
public LinkBuilder linkForSingleResource(Identifiable<?> entity)
- Description copied from interface:
EntityLinks
- Returns a
LinkBuilder able to create links to the controller managing the given entity.
- Specified by:
linkForSingleResource in interface EntityLinks
- Parameters:
entity - the entity type to point to, must not be null.
- Returns:
- the
LinkBuilder pointing the given entity. Will never be null. - See Also:
EntityLinks.linkForSingleResource(Class, Object)
Copyright © 2012-2014–2014 Pivotal, Inc.. All rights reserved.