Interface Link

  • All Known Implementing Classes:
    ImmutableLink

    @Immutable
    public interface Link
    Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Optional<String> anchor()
      When present, the anchor parameter overrides this with another URI, such as a fragment of this resource, or a third resource (i.e., when the anchor value is an absolute URI).
      static Link from​(String[] linkValues)
      Construct a Link object from an array of link header strings.
      Optional<String> media()
      The "media" parameter, when present, is used to indicate intended destination medium or media for style information (see [W3C.REC-html401-19991224], Section 6.13).
      Optional<String> rel()
      The relation type of a link is conveyed in the "rel" parameter's value.
      Optional<String> rev()
      The "rev" parameter has been used in the past to indicate that the semantics of the relationship are in the reverse direction.
      Optional<String> title()
      The "title" parameter, when present, is used to label the destination of a link such that it can be used as a human-readable identifier (e.g., a menu entry) in the language indicated by the Content- Language header (if present).
      Optional<String> type()
      The "type" parameter, when present, is a hint indicating what the media type of the result of dereferencing the link should be.
      URI url()
      Link value.
    • Method Detail

      • url

        URI url()
        Link value.
        Returns:
        url
      • rel

        Optional<String> rel()
        The relation type of a link is conveyed in the "rel" parameter's value. The "rel" parameter MUST NOT appear more than once in a given link-value; occurrences after the first MUST be ignored by parsers.
        Returns:
        relation type
      • rev

        Optional<String> rev()
        The "rev" parameter has been used in the past to indicate that the semantics of the relationship are in the reverse direction. That is, a link from A to B with REL="X" expresses the same relationship as a link from B to A with REV="X". "rev" is deprecated by this specification because it often confuses authors and readers; in most cases, using a separate relation type is preferable.
        Returns:
        relation type
      • type

        Optional<String> type()
        The "type" parameter, when present, is a hint indicating what the media type of the result of dereferencing the link should be. Note that this is only a hint; for example, it does not override the Content-Type header of a HTTP response obtained by actually following the link. There MUST NOT be more than one type parameter in a link- value.
        Returns:
        type
      • media

        Optional<String> media()
        The "media" parameter, when present, is used to indicate intended destination medium or media for style information (see [W3C.REC-html401-19991224], Section 6.13). Note that this may be updated by [W3C.CR-css3-mediaqueries-20090915]). Its value MUST be quoted if it contains a semicolon (";") or comma (","), and there MUST NOT be more than one "media" parameter in a link-value.
        Returns:
        media
      • title

        Optional<String> title()
        The "title" parameter, when present, is used to label the destination of a link such that it can be used as a human-readable identifier (e.g., a menu entry) in the language indicated by the Content- Language header (if present). The "title" parameter MUST NOT appear more than once in a given link-value; occurrences after the first MUST be ignored by parsers.
        Returns:
        title
      • anchor

        Optional<String> anchor()
        When present, the anchor parameter overrides this with another URI, such as a fragment of this resource, or a third resource (i.e., when the anchor value is an absolute URI).
        Returns:
        anchor
      • from

        static Link from​(String[] linkValues)
        Construct a Link object from an array of link header strings.
        Parameters:
        linkValues - an array of link header strings
        Returns:
        link object