Class HalLink

java.lang.Object
org.apache.juneau.bean.hal.HalLink

@Marshalled public class HalLink extends Object
Represents a HAL Link Object as defined by draft-kelly-json-hal-08 § 5.

A Link Object describes a hyperlink from the containing resource to another resource. The href property is the only required field; all other fields are optional.

See Also:
  • Constructor Details

    • HalLink

      public HalLink()
      Default constructor.
    • HalLink

      public HalLink(String href)
      Convenience constructor with the required href field.
      Parameters:
      href - The link URI or URI template. Can be null to leave the property unset.
  • Method Details

    • getHref

      public String getHref()
      Bean property getter: href.

      The link's target URI or URI template (per RFC 6570). This is the only required HAL Link field.

      Returns:
      The value of the href property, or null if it is not set.
    • setHref

      public HalLink setHref(String value)
      Bean property setter: href.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • getTemplated

      Bean property getter: templated.

      Indicates whether href is a URI template per RFC 6570.

      Returns:
      The value of the templated property, or null if it is not set.
    • setTemplated

      public HalLink setTemplated(Boolean value)
      Bean property setter: templated.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • getType

      public String getType()
      Bean property getter: type.

      A hint about the media type expected when dereferencing the target resource.

      Returns:
      The value of the type property, or null if it is not set.
    • setType

      public HalLink setType(String value)
      Bean property setter: type.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • getDeprecation

      Bean property getter: deprecation.

      A URL providing information about deprecation of the link.

      Returns:
      The value of the deprecation property, or null if it is not set.
    • setDeprecation

      public HalLink setDeprecation(String value)
      Bean property setter: deprecation.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • getName

      public String getName()
      Bean property getter: name.

      A secondary key for selecting a link from a set sharing the same relation.

      Returns:
      The value of the name property, or null if it is not set.
    • setName

      public HalLink setName(String value)
      Bean property setter: name.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • getProfile

      public String getProfile()
      Bean property getter: profile.

      A URI hint about the profile (additional semantics) of the target resource.

      Returns:
      The value of the profile property, or null if it is not set.
    • setProfile

      public HalLink setProfile(String value)
      Bean property setter: profile.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • getTitle

      public String getTitle()
      Bean property getter: title.

      A human-readable identifier for the link, suitable for display.

      Returns:
      The value of the title property, or null if it is not set.
    • setTitle

      public HalLink setTitle(String value)
      Bean property setter: title.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • getHreflang

      public String getHreflang()
      Bean property getter: hreflang.

      The language of the target resource (RFC 5646 language tag).

      Returns:
      The value of the hreflang property, or null if it is not set.
    • setHreflang

      public HalLink setHreflang(String value)
      Bean property setter: hreflang.
      Parameters:
      value - The new value for this property. Can be null to unset the property.
      Returns:
      This object.
    • toString

      public String toString()
      Overrides:
      toString in class Object