Package io.micronaut.http.hateoas
Class AbstractResource<Impl extends AbstractResource<Impl>>
java.lang.Object
io.micronaut.http.hateoas.AbstractResource<Impl>
- Type Parameters:
Impl
- An Abstract resource implementation
- All Implemented Interfaces:
Resource
- Direct Known Subclasses:
GenericResource
,JsonError
@Produces("application/hal+json")
@Introspected
public abstract class AbstractResource<Impl extends AbstractResource<Impl>>
extends Object
implements Resource
An abstract implementation of
Resource
.- Since:
- 1.1
- Author:
- Graeme Rocher
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionembedded
(CharSequence ref, Resource resource) Add an embedded resource with the given reference.embedded
(CharSequence ref, Resource... resource) Add an embedded resource with the given reference.embedded
(CharSequence ref, List<Resource> resourceList) Add an embedded resource with the given reference.getLinks()
link
(@Nullable CharSequence ref, @Nullable Link link) Add a link with the given reference.link
(@Nullable CharSequence ref, @Nullable String link) Add a link with the given reference.final void
setEmbedded
(Map<String, List<Resource>> embedded) Allows de-serializing of embedded with Jackson.final void
Allows de-serializing of links with Jackson.
-
Constructor Details
-
AbstractResource
public AbstractResource()
-
-
Method Details
-
link
Add a link with the given reference.- Parameters:
ref
- The referencelink
- The link- Returns:
- This JsonError
-
link
Add a link with the given reference.- Parameters:
ref
- The referencelink
- The link- Returns:
- This JsonError
-
embedded
Add an embedded resource with the given reference.- Parameters:
ref
- The referenceresource
- The resource- Returns:
- This JsonError
-
embedded
Add an embedded resource with the given reference.- Parameters:
ref
- The referenceresource
- The resource- Returns:
- This JsonError
-
embedded
Add an embedded resource with the given reference.- Parameters:
ref
- The referenceresourceList
- The resources- Returns:
- This JsonError
-
getLinks
-
getEmbedded
- Specified by:
getEmbedded
in interfaceResource
- Returns:
- The embedded resources
-
setLinks
Allows de-serializing of links with Jackson.- Parameters:
links
- The links
-
setEmbedded
Allows de-serializing of embedded with Jackson.- Parameters:
embedded
- The links
-