java.lang.Object
com.genologics.ri.Link
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the relative part of the link.getUri()Gets the URI of the link.static StringlimsIdFromUri(Locatable thing) Extract the LIMS identifier from the URI of a Locatable object.static StringlimsIdFromUri(URI uri) Extract the LIMS identifier from a URI.voidsetRelative(String rel) Sets the relative part of the link.voidSets the URI of the link.toString()Gets a string representation of the link.
-
Field Details
-
UNSET
Shared constant for use throughout this library to indicate a field is not set.- See Also:
-
relative
The relative part of the link. -
uri
The URI of the link.
-
-
Constructor Details
-
Link
public Link()Default constructor. -
Link
Constructor with relative part.- Parameters:
rel- The relative part of the link.
-
Link
Constructor with relative part and URI.- Parameters:
rel- The relative part of the link.uri- The URI.
-
Link
Constructor from a linkable object.- Parameters:
linkable- The linkable object.
-
-
Method Details
-
getRelative
Gets the relative part of the link.- Returns:
- The relative part.
-
setRelative
Sets the relative part of the link.- Parameters:
rel- The relative part.
-
getUri
Gets the URI of the link. -
setUri
Sets the URI of the link. -
toString
Gets a string representation of the link. -
limsIdFromUri
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
uriis null.
-
limsIdFromUri
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
thingis null.
-