Package com.helixframework.api.contract
Class HalLink.Builder
java.lang.Object
com.helixframework.api.contract.HalLink.Builder
- Enclosing class:
- HalLink
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a new HalLink instance with the configured properties.deprecation(String deprecation) Sets the deprecation URL that provides information about why the link is deprecated.Sets the href (URL) for the link.Sets the language tag of the target resource.Sets the language tag of the target resource using language and country codes.Sets the language tag of the target resource using a Locale object.Adds a key-value pair to the metadata map.Sets the metadata map for this link.method(HalLink.HttpMethod method) Sets the HTTP method for this link in the metadata.Sets the HTTP method for this link in the metadata.Sets the name of the link.Sets the profile URL that provides documentation about the link relation type.Marks the href as a URI template.templated(boolean templated) Marks the href as a URI template.Sets the human-readable title of the link.Sets the media type of the target resource.
-
Method Details
-
href
Sets the href (URL) for the link.- Parameters:
href- The URL to set- Returns:
- This builder instance
-
templated
Marks the href as a URI template.- Parameters:
templated- A boolean indicating if the href is a URI template- Returns:
- This builder instance
-
templated
Marks the href as a URI template.- Returns:
- This builder instance
-
type
Sets the media type of the target resource.- Parameters:
type- The media type to set- Returns:
- This builder instance
-
deprecation
Sets the deprecation URL that provides information about why the link is deprecated.- Parameters:
deprecation- The deprecation URL to set- Returns:
- This builder instance
-
name
Sets the name of the link.- Parameters:
name- The name to set- Returns:
- This builder instance
-
profile
Sets the profile URL that provides documentation about the link relation type.- Parameters:
profile- The profile URL to set- Returns:
- This builder instance
-
title
Sets the human-readable title of the link.- Parameters:
title- The title to set- Returns:
- This builder instance
-
hreflang
Sets the language tag of the target resource.- Parameters:
hreflang- The language tag to set- Returns:
- This builder instance
-
hreflang
Sets the language tag of the target resource using a Locale object.- Parameters:
locale- The locale to derive the language tag from- Returns:
- This builder instance
-
hreflang
Sets the language tag of the target resource using language and country codes.- Parameters:
language- The language codecountry- The country code- Returns:
- This builder instance
-
method
Sets the HTTP method for this link in the metadata.- Parameters:
method- The HTTP method to set- Returns:
- This builder instance
-
method
Sets the HTTP method for this link in the metadata.- Parameters:
method- The HTTP method to set- Returns:
- This builder instance
-
meta
Sets the metadata map for this link.- Parameters:
meta- The metadata map to set- Returns:
- This builder instance
-
meta
Adds a key-value pair to the metadata map.- Parameters:
key- The metadata keyvalue- The metadata value- Returns:
- This builder instance
- Throws:
IllegalArgumentException- if key is null
-
build
Builds and returns a new HalLink instance with the configured properties.- Returns:
- A new HalLink instance
- Throws:
IllegalStateException- if href is null or empty
-