Class RepositoryEntityLinks
java.lang.Object
org.springframework.hateoas.server.core.AbstractEntityLinks
org.springframework.data.rest.webmvc.support.RepositoryEntityLinks
- All Implemented Interfaces:
EntityLinks
,org.springframework.plugin.core.Plugin<Class<?>>
EntityLinks
implementation that is able to create Link
for domain classes managed by Spring Data
REST.- Author:
- Jon Brisbin, Oliver Gierke
-
Constructor Summary
ConstructorDescriptionRepositoryEntityLinks
(Repositories repositories, ResourceMappings mappings, RepositoryRestConfiguration config, PagingAndSortingTemplateVariables templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters) RepositoryEntityLinks
(Repositories repositories, ResourceMappings mappings, RepositoryRestConfiguration config, Lazy<PagingAndSortingTemplateVariables> templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters) -
Method Summary
Modifier and TypeMethodDescriptionlinkForItemResource
(Class<?> type, Object id) linksToSearchResources
(Class<?> type) Returns all links to search resource for the given type.linksToSearchResources
(Class<?> type, Pageable pageable) Returns all link to search resources for the given type, pre-expanded with the givenPageable
if applicable.linksToSearchResources
(Class<?> type, Sort sort) Returns all link to search resources for the given type, pre-expanded with the givenSort
if applicable.linkToCollectionResource
(Class<?> type) linkToItemResource
(Class<?> type, Object id) linkToPagedResource
(Class<?> type, Pageable pageable) Returns the link to to the paged colelction resource for the given type, pre-expanding thelinkToSearchResource
(Class<?> domainType, LinkRelation relation) Creates the link to the search resource with the givenLinkRelation
for a given type.linkToSearchResource
(Class<?> domainType, LinkRelation relation, Pageable pageable) Creates the link to the search resource with the givenLinkRelation
for a given type.linkToSearchResource
(Class<?> domainType, LinkRelation relation, Sort sort) Creates the link to the search resource with the givenLinkRelation
for a given type.boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.hateoas.server.EntityLinks
forType, forType, linkForItemResource, linkToItemResource
-
Constructor Details
-
RepositoryEntityLinks
public RepositoryEntityLinks(Repositories repositories, ResourceMappings mappings, RepositoryRestConfiguration config, PagingAndSortingTemplateVariables templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters) -
RepositoryEntityLinks
public RepositoryEntityLinks(Repositories repositories, ResourceMappings mappings, RepositoryRestConfiguration config, Lazy<PagingAndSortingTemplateVariables> templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters)
-
-
Method Details
-
supports
-
linkFor
-
linkFor
-
linkToPagedResource
Returns the link to to the paged colelction resource for the given type, pre-expanding the- Parameters:
type
- must not be null.pageable
- the pageable to can be null.- Returns:
-
linkToCollectionResource
-
linkToItemResource
-
linkForItemResource
- Specified by:
linkForItemResource
in interfaceEntityLinks
- Overrides:
linkForItemResource
in classAbstractEntityLinks
-
linksToSearchResources
Returns all links to search resource for the given type.- Parameters:
type
- must not be null.- Returns:
- Since:
- 2.3
-
linksToSearchResources
Returns all link to search resources for the given type, pre-expanded with the givenPageable
if applicable.- Parameters:
type
- must not be null.pageable
- can be null.- Returns:
- Since:
- 2.3
-
linksToSearchResources
Returns all link to search resources for the given type, pre-expanded with the givenSort
if applicable.- Parameters:
type
- must not be null.sort
- can be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
Creates the link to the search resource with the givenLinkRelation
for a given type.- Parameters:
domainType
- must not be null.relation
- must not be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
Creates the link to the search resource with the givenLinkRelation
for a given type. Uses the givenPageable
to pre-expand potentially available template variables.- Parameters:
domainType
- must not be null.relation
- must not be null.pageable
- can be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
Creates the link to the search resource with the givenLinkRelation
for a given type. Uses the givenSort
to pre-expand potentially available template variables.- Parameters:
domainType
- must not be null.relation
- must not be null.sort
- can be null.- Returns:
- Since:
- 2.3
-