java.lang.Object
org.springframework.restdocs.hypermedia.Link

public class Link extends Object
Representation of a link used in a Hypermedia-based API.
Author:
Andy Wilkinson
  • Constructor Details

    • Link

      public Link(String rel, String href)
      Creates a new Link with the given rel and href.
      Parameters:
      rel - the link's rel
      href - the link's href
    • Link

      public Link(String rel, String href, String title)
      Creates a new Link with the given rel, href, and title.
      Parameters:
      rel - the link's rel
      href - the link's href
      title - the link's title
  • Method Details

    • getRel

      public String getRel()
      Returns the link's rel.
      Returns:
      the link's rel
    • getHref

      public String getHref()
      Returns the link's href.
      Returns:
      the link's href
    • getTitle

      public String getTitle()
      Returns the link's title, or null if it does not have a title.
      Returns:
      the link's title or null
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object