Package io.wcm.caravan.hal.resource
Class Link
- java.lang.Object
-
- io.wcm.caravan.hal.resource.Link
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getDeprecation()
String
getHref()
String
getHreflang()
com.fasterxml.jackson.databind.node.ObjectNode
getModel()
Returns the JSON model.String
getName()
String
getProfile()
String
getTitle()
String
getType()
int
hashCode()
boolean
isTemplated()
void
remove()
Removes this link from its context resource's JSON representationLink
setDeprecation(String deprecation)
Link
setHref(String href)
Link
setHreflang(String hreflang)
Link
setName(String name)
Link
setProfile(String profile)
Link
setTemplated(boolean templated)
Link
setTitle(String title)
Link
setType(String type)
-
-
-
Constructor Detail
-
Link
public Link(com.fasterxml.jackson.databind.JsonNode model)
- Parameters:
model
- JSON model
-
Link
public Link(com.fasterxml.jackson.databind.node.ObjectNode model)
- Parameters:
model
- JSON model
-
Link
public Link(String href)
Creates a link with a new model that only contains the given URI- Parameters:
href
- the URI to put in the "href" property
-
-
Method Detail
-
getModel
public com.fasterxml.jackson.databind.node.ObjectNode getModel()
Description copied from interface:HalObject
Returns the JSON model.
-
getType
public String getType()
- Returns:
- the type
-
getDeprecation
public String getDeprecation()
- Returns:
- the deprecation
-
setDeprecation
public Link setDeprecation(String deprecation)
- Parameters:
deprecation
- the deprecation to set- Returns:
- Link
-
getName
public String getName()
- Returns:
- the name
-
getProfile
public String getProfile()
- Returns:
- the profile
-
setProfile
public Link setProfile(String profile)
- Parameters:
profile
- the profile to set- Returns:
- Link
-
getTitle
public String getTitle()
- Returns:
- the title
-
getHreflang
public String getHreflang()
- Returns:
- the hreflang
-
setHreflang
public Link setHreflang(String hreflang)
- Parameters:
hreflang
- the hreflang to set- Returns:
- Link
-
getHref
public String getHref()
- Returns:
- the href
-
isTemplated
public boolean isTemplated()
- Returns:
- is templated
-
setTemplated
public Link setTemplated(boolean templated)
- Parameters:
templated
- the templated to set- Returns:
- Link
-
remove
public void remove()
Removes this link from its context resource's JSON representation- Throws:
IllegalStateException
- if this link was never added to a resource, or has already been removed
-
-