Package com.helixframework.api.contract
Class HalLink
java.lang.Object
com.helixframework.api.contract.HalLink
Represents a hypermedia link in the HAL (Hypertext Application Language) format.
This class is immutable and provides properties to describe a hyperlink,
along with additional metadata.
The HalLink class is designed to work with JSON serialization/deserialization
and follows the HAL link structure, including standard fields and optional custom metadata.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumRepresents the HTTP methods typically used in RESTful APIs. -
Method Summary
Modifier and TypeMethodDescriptionstatic HalLink.BuilderCreates a new builder instance initialized with values from an existing HalLink.static HalLink.BuilderCreates a new builder instance with the specified href value.static HalLink.Builderbuilder(String href, HalLink.HttpMethod method) Creates a new builder instance with the specified href and HTTP method.booleanGets the deprecation URL that provides information about why the link is deprecated.getHref()Gets the href (URL) of the link.Gets the language tag of the target resource.getMeta()Gets the additional metadata associated with the link.getName()Gets the name of the link.Gets the profile URL that provides documentation about the link relation type.Indicates whether the href is a URI template.getTitle()Gets the human-readable title of the link.getType()Gets the media type of the target resource.inthashCode()static HalLinkCreates a new HalLink instance with the specified href.static HalLinkof(String href, HalLink.HttpMethod method) Creates a new HalLink instance with the specified href and HTTP method.toString()
-
Method Details
-
builder
Creates a new builder instance initialized with values from an existing HalLink.- Parameters:
link- The HalLink to copy values from- Returns:
- A new Builder instance
-
builder
Creates a new builder instance with the specified href value.- Parameters:
href- The href URL to set- Returns:
- A new Builder instance
-
builder
Creates a new builder instance with the specified href and HTTP method.- Parameters:
href- The href URL to setmethod- The HTTP method to associate with the link- Returns:
- A new Builder instance
-
of
Creates a new HalLink instance with the specified href.- Parameters:
href- The href URL to set- Returns:
- A new HalLink instance
-
of
Creates a new HalLink instance with the specified href and HTTP method.- Parameters:
href- The href URL to setmethod- The HTTP method to associate with the link- Returns:
- A new HalLink instance
-
getHref
Gets the href (URL) of the link.- Returns:
- The href URL
-
getTemplated
Indicates whether the href is a URI template.- Returns:
- true if the href is templated, false otherwise
-
getType
Gets the media type of the target resource.- Returns:
- The media type
-
getDeprecation
Gets the deprecation URL that provides information about why the link is deprecated.- Returns:
- The deprecation URL
-
getName
Gets the name of the link.- Returns:
- The link name
-
getProfile
Gets the profile URL that provides documentation about the link relation type.- Returns:
- The profile URL
-
getTitle
Gets the human-readable title of the link.- Returns:
- The link title
-
getHreflang
Gets the language tag of the target resource.- Returns:
- The language tag
-
getMeta
Gets the additional metadata associated with the link.- Returns:
- An unmodifiable map of metadata, or an empty map if no metadata exists
-
equals
-
hashCode
public int hashCode() -
toString
-