Class Link

java.lang.Object
io.spring.initializr.metadata.Link

public class Link extends Object
Metadata for a link. Each link has a "relation" that potentially attaches a strong semantic to the nature of the link. The URI of the link itself can be templated by including variables in the form `{variableName}`.

An actual URI can be generated using expand, providing a mapping for those variables.

Author:
Dave Syer, Stephane Nicoll
  • Constructor Details

    • Link

      public Link()
  • Method Details

    • getRel

      public String getRel()
    • setRel

      public void setRel(String rel)
    • isTemplated

      public boolean isTemplated()
    • setTemplated

      public void setTemplated(boolean templated)
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getHref

      public String getHref()
    • getTemplateVariables

      public Set<String> getTemplateVariables()
    • setHref

      public void setHref(String href)
    • resolve

      public void resolve()
    • expand

      public URI expand(Map<String,String> parameters)
      Expand the link using the specified parameters.
      Parameters:
      parameters - the parameters value
      Returns:
      an URI where all variables have been expanded
    • create

      public static Link create(String rel, String href)
    • create

      public static Link create(String rel, String href, String description)
    • create

      public static Link create(String rel, String href, boolean templated)