Class Link

java.lang.Object
com.genologics.ri.Link
All Implemented Interfaces:
Locatable, Serializable

public class Link extends Object implements Locatable, Serializable
A link provides a URI linking to an additional resource.

The link is modelled on the link element defined by the Atom Syndication Format. The link includes a rel attribute that describes the URI of the link.

See Also:
  • Field Details

    • relative

      protected String relative
    • uri

      protected URI uri
  • Constructor Details

    • Link

      public Link()
    • Link

      public Link(String rel)
    • Link

      public Link(String rel, URI uri)
    • Link

      public Link(Linkable<?> limsLink)
  • Method Details

    • getRelative

      public String getRelative()
    • setRelative

      public void setRelative(String rel)
    • getUri

      public URI getUri()
      Description copied from interface: Locatable
      Get the URI of this object.
      Specified by:
      getUri in interface Locatable
      Returns:
      The URI.
    • setUri

      public void setUri(URI uri)
      Description copied from interface: Locatable
      Set the URI of this object.
      Specified by:
      setUri in interface Locatable
      Parameters:
      uri - The new URI.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • limsIdFromUri

      public static String limsIdFromUri(URI uri)
      Extract the LIMS identifier from a URI. The identifier is the last part of the URI path.
      Parameters:
      uri - The URI.
      Returns:
      The id from the URI path, or null if uri is null.
    • limsIdFromUri

      public static String limsIdFromUri(Locatable thing)
      Extract the LIMS identifier from the URI of a Locatable object.
      Parameters:
      thing - The Locatable object.
      Returns:
      The id from the object's URI, or null if thing is null.