public class HalRepresentation
extends java.lang.Object
Constructor and Description |
---|
HalRepresentation() |
HalRepresentation(Links links)
Creates a HalRepresentation having
Links |
HalRepresentation(Links links,
Curies curies)
Deprecated.
This method will most likely not be required by any users of edison-hal. Please contact me,
if you need this, otherwise the constructor will be removed in 3.0.0
|
HalRepresentation(Links links,
Embedded embedded)
|
HalRepresentation(Links links,
Embedded embedded,
Curies curies)
Deprecated.
This method will most likely not be required by any users of edison-hal. Please contact me,
if you need this, otherwise the constructor will be removed in 3.0.0
|
Modifier and Type | Method and Description |
---|---|
protected HalRepresentation |
add(Links links)
Add links to the HalRepresentation.
|
boolean |
equals(java.lang.Object o) |
com.fasterxml.jackson.databind.JsonNode |
getAttribute(java.lang.String name)
Returns the value of an extra attribute as a JsonNode, or null if no such attribute is present.
|
java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> |
getAttributes()
Returns extra attributes that were not mapped to properties of the HalRepresentation.
|
Embedded |
getEmbedded()
Returns the Embedded objects of the HalRepresentation.
|
Links |
getLinks()
Returns the Links of the HalRepresentation.
|
int |
hashCode() |
java.lang.String |
toString() |
protected HalRepresentation |
withEmbedded(java.lang.String rel,
HalRepresentation embeddedItem)
Adds an embedded item for a link-relation type to the HalRepresentation.
|
protected HalRepresentation |
withEmbedded(java.lang.String rel,
java.util.List<? extends HalRepresentation> embeddedItems)
Adds embedded items for a link-relation type to the HalRepresentation.
|
public HalRepresentation()
public HalRepresentation(Links links)
Links
links
- the Links of the HalRepresentation@Deprecated public HalRepresentation(Links links, Curies curies)
Links
and a Curies that can be used
to configure the link-relation types that should always be rendered as an array of links.links
- the Links of the HalRepresentationcuries
- the Curies used to resolve curiespublic HalRepresentation(Links links, Embedded embedded)
Creates a HalRepresentation with Links
and Embedded
objects.
If the Links do contain CURIs, the link-relation types of the embedded objects are shortened.
links
- the Links of the HalRepresentationembedded
- the Embedded items of the HalRepresentation@Deprecated public HalRepresentation(Links links, Embedded embedded, Curies curies)
Creates a HalRepresentation with Links
, Embedded
objects and a Curies used to
resolve curies from parent representations.
If the Links do contain CURIs, the matching link-relation types of links and embedded objects are shortened.
links
- the Links of the HalRepresentationembedded
- the Embedded items of the HalRepresentationcuries
- the Curies used to resolve curiespublic Links getLinks()
protected HalRepresentation add(Links links)
Links are only added if they are not equivalent
to already existing links.
links
- links that are added to this HalRepresentationpublic Embedded getEmbedded()
empty
public java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> getAttributes()
public com.fasterxml.jackson.databind.JsonNode getAttribute(java.lang.String name)
name
- the name of the attributeprotected HalRepresentation withEmbedded(java.lang.String rel, java.util.List<? extends HalRepresentation> embeddedItems)
If rel
is already present, it is replaced by the new embedded items.
rel
- the link-relation type of the embedded items that are added or replacedembeddedItems
- the new values for the specified link-relation typeprotected HalRepresentation withEmbedded(java.lang.String rel, HalRepresentation embeddedItem)
The embedded item will be rendered as a single resource object.
If rel
is already present, it is replaced by the new embedded items.
rel
- the link-relation type of the embedded item that is added or replacedembeddedItem
- the new value for the specified link-relation typepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object