Class RepositoryEntityLinks
java.lang.Object
org.springframework.hateoas.server.core.AbstractEntityLinks
org.springframework.data.rest.webmvc.support.RepositoryEntityLinks
- All Implemented Interfaces:
org.springframework.hateoas.server.EntityLinks,org.springframework.plugin.core.Plugin<Class<?>>
public class RepositoryEntityLinks
extends org.springframework.hateoas.server.core.AbstractEntityLinks
EntityLinks implementation that is able to create Link for domain classes managed by Spring Data
REST.- Author:
- Jon Brisbin, Oliver Gierke
-
Constructor Summary
ConstructorsConstructorDescriptionRepositoryEntityLinks(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 TypeMethodDescriptionorg.springframework.hateoas.server.LinkBuilderorg.springframework.hateoas.server.LinkBuilderorg.springframework.hateoas.server.LinkBuilderlinkForItemResource(Class<?> type, Object id) org.springframework.hateoas.LinkslinksToSearchResources(Class<?> type) Returns all links to search resource for the given type.org.springframework.hateoas.LinkslinksToSearchResources(Class<?> type, Pageable pageable) Returns all link to search resources for the given type, pre-expanded with the givenPageableif applicable.org.springframework.hateoas.LinkslinksToSearchResources(Class<?> type, Sort sort) Returns all link to search resources for the given type, pre-expanded with the givenSortif applicable.org.springframework.hateoas.LinklinkToCollectionResource(Class<?> type) org.springframework.hateoas.LinklinkToItemResource(Class<?> type, Object id) org.springframework.hateoas.LinklinkToPagedResource(Class<?> type, Pageable pageable) Returns the link to to the paged colelction resource for the given type, pre-expanding theorg.springframework.hateoas.LinklinkToSearchResource(Class<?> domainType, org.springframework.hateoas.LinkRelation relation) Creates the link to the search resource with the givenLinkRelationfor a given type.org.springframework.hateoas.LinklinkToSearchResource(Class<?> domainType, org.springframework.hateoas.LinkRelation relation, Pageable pageable) Creates the link to the search resource with the givenLinkRelationfor a given type.org.springframework.hateoas.LinklinkToSearchResource(Class<?> domainType, org.springframework.hateoas.LinkRelation relation, Sort sort) Creates the link to the search resource with the givenLinkRelationfor a given type.booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
linkForItemResourcein interfaceorg.springframework.hateoas.server.EntityLinks- Overrides:
linkForItemResourcein classorg.springframework.hateoas.server.core.AbstractEntityLinks
-
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 givenPageableif 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 givenSortif applicable.- Parameters:
type- must not be null.sort- can be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
public org.springframework.hateoas.Link linkToSearchResource(Class<?> domainType, org.springframework.hateoas.LinkRelation relation) Creates the link to the search resource with the givenLinkRelationfor a given type.- Parameters:
domainType- must not be null.relation- must not be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
public org.springframework.hateoas.Link linkToSearchResource(Class<?> domainType, org.springframework.hateoas.LinkRelation relation, Pageable pageable) Creates the link to the search resource with the givenLinkRelationfor a given type. Uses the givenPageableto 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
public org.springframework.hateoas.Link linkToSearchResource(Class<?> domainType, org.springframework.hateoas.LinkRelation relation, Sort sort) Creates the link to the search resource with the givenLinkRelationfor a given type. Uses the givenSortto 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
-