Class DefaultLinkCollector
java.lang.Object
org.springframework.data.rest.webmvc.mapping.DefaultLinkCollector
- All Implemented Interfaces:
LinkCollector
A service to collect all standard links that need to be added to a certain object.
- Since:
- 3.6
- Author:
- Oliver Drotbohm
-
Constructor Summary
ConstructorDescriptionDefaultLinkCollector
(org.springframework.data.mapping.context.PersistentEntities entities, SelfLinkProvider linkProvider, Associations associationLinks) Creates a newDefaultLinkCollector
for the givenPersistentEntities
,SelfLinkProvider
andAssociations
. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.hateoas.Links
getLinksFor
(Object object) Returns allLinks
for the given object.org.springframework.hateoas.Links
getLinksFor
(Object object, org.springframework.hateoas.Links existingLinks) Returns allLinks
for the given object and already existingLink
.org.springframework.hateoas.Links
getLinksForNested
(Object object, org.springframework.hateoas.Links existing)
-
Constructor Details
-
DefaultLinkCollector
public DefaultLinkCollector(org.springframework.data.mapping.context.PersistentEntities entities, SelfLinkProvider linkProvider, Associations associationLinks) Creates a newDefaultLinkCollector
for the givenPersistentEntities
,SelfLinkProvider
andAssociations
.- Parameters:
entities
- must not be null.linkProvider
- must not be null.associationLinks
- must not be null.
-
-
Method Details
-
getLinksFor
Returns allLinks
for the given object.- Specified by:
getLinksFor
in interfaceLinkCollector
- Parameters:
object
- must not be null.- Returns:
-
getLinksFor
public org.springframework.hateoas.Links getLinksFor(Object object, org.springframework.hateoas.Links existingLinks) Returns allLinks
for the given object and already existingLink
.- Specified by:
getLinksFor
in interfaceLinkCollector
- Parameters:
object
- must not be null.existingLinks
- must not be null.- Returns:
-
getLinksForNested
public org.springframework.hateoas.Links getLinksForNested(Object object, org.springframework.hateoas.Links existing) - Specified by:
getLinksForNested
in interfaceLinkCollector
-