public interface EntityLinks extends org.springframework.plugin.core.Plugin<Class<?>>
IllegalArgumentException
potentially
thrown by the declared methods will only appear if the #supports(Class)
method has returned false
and the method has been invoked anyway, i.e. if #supports(Class)
returns true it's safe to invoke
the interface methods an the exception will never be thrown.Modifier and Type | Method and Description |
---|---|
LinkBuilder |
linkFor(Class<?> type)
Returns a
LinkBuilder able to create links to the controller managing the given entity type. |
LinkBuilder |
linkFor(Class<?> type,
Object... parameters)
Returns a
LinkBuilder able to create links to the controller managing the given entity type, unfolding the
given parameters into the URI template the backing controller is mapped to. |
LinkBuilder |
linkForSingleResource(Class<?> type,
Object id)
Returns a
LinkBuilder able to create links to the controller managing the given entity type and id. |
LinkBuilder |
linkForSingleResource(Identifiable<?> entity)
Returns a
LinkBuilder able to create links to the controller managing the given entity. |
Link |
linkToCollectionResource(Class<?> type)
Creates a
Link pointing to the collection resource of the given type. |
Link |
linkToSingleResource(Class<?> type,
Object id)
Creates a
Link pointing to single resource backing the given entity type and id. |
Link |
linkToSingleResource(Identifiable<?> entity)
Creates a
Link pointing to single resource backing the given entity. |
LinkBuilder linkFor(Class<?> type)
LinkBuilder
able to create links to the controller managing the given entity type. Expects a
controller being mapped to a fully expanded URI template (i.e. not path variables being used).type
- the entity type to point to, must not be null.LinkBuilder
pointing to the collection resource. Will never be null.IllegalArgumentException
- in case the given type is unknown the entity links infrastructure.LinkBuilder linkFor(Class<?> type, Object... parameters)
LinkBuilder
able to create links to the controller managing the given entity type, unfolding the
given parameters into the URI template the backing controller is mapped to.type
- the entity type to point to, must not be null.LinkBuilder
pointing to the collection resource.IllegalArgumentException
- in case the given type is unknown the entity links infrastructure.LinkBuilder linkForSingleResource(Class<?> type, Object id)
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.type
- the entity type to point to, must not be null.id
- the id of the object of the handed type, Identifiable
s will be unwrapped.LinkBuilder
pointing to the single resource identified by the given type and id. Will never be
null.IllegalArgumentException
- in case the given type is unknown the entity links infrastructure.LinkBuilder linkForSingleResource(Identifiable<?> entity)
LinkBuilder
able to create links to the controller managing the given entity.entity
- the entity type to point to, must not be null.LinkBuilder
pointing the given entity. Will never be null.IllegalArgumentException
- in case the type of the given entity is unknown the entity links infrastructure.linkForSingleResource(Class, Object)
Link linkToCollectionResource(Class<?> type)
Link
pointing to the collection resource of the given type. The relation type of the link will be
determined by the implementation class and should be defaulted to Link.REL_SELF
.type
- the entity type to point to, must not be null.Link
pointing to the collection resource exposed for the given entity. Will never be
null.IllegalArgumentException
- in case the given type is unknown the entity links infrastructure.Link linkToSingleResource(Class<?> type, Object id)
Link
pointing to single resource backing the given entity type and id. The relation type of the
link will be determined by the implementation class and should be defaulted to Link.REL_SELF
.type
- the entity type to point to, must not be null.id
- the identifier of the entity of the given typeLink
pointing to the resource exposed for the entity with the given type and id. Will never be
null.IllegalArgumentException
- in case the given type is unknown the entity links infrastructure.Link linkToSingleResource(Identifiable<?> entity)
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
.entity
- the entity type to point to, must not be null.Link
pointing to the resource exposed for the given entity. Will never be null.IllegalArgumentException
- in case the type of the given entity is unknown the entity links infrastructure.Copyright © 2012-2016–2018 Pivotal, Inc.. All rights reserved.