Class IridaRepresentationModel
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.model.IridaRepresentationModel
-
- Direct Known Subclasses:
AbstractAnalysisSubmission,Analysis,AnalysisOutputFile,GenomeAssembly,JobError,LabelledRelationshipResource,Project,ProjectHashResource,ResourceCollection,ResourceList,Sample,SampleMetadataResponse,SequenceFile,SequencingObject,SequencingRun,User
public class IridaRepresentationModel extends java.lang.ObjectAdds a collection ofLinks to extending objects. Similar toRepresentationModel- See Also:
RepresentationModel
-
-
Constructor Summary
Constructors Constructor Description IridaRepresentationModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Iterable<org.springframework.hateoas.Link> links)Adds all givenLinks to the resource.voidadd(org.springframework.hateoas.Link link)Adds the given link to the resource.booleanequals(java.lang.Object obj)java.util.Optional<org.springframework.hateoas.Link>getLink(java.lang.String rel)Returns the link with the given rel.java.util.List<org.springframework.hateoas.Link>getLinks()Returns allLinks contained in this resource.RemoteStatusgetRemoteStatus()Get theRemoteStatusfor this object if it was read from a remote sourcejava.lang.StringgetSelfHref()Convenience method for getting the self rel href for an object read from a remote siteinthashCode()booleanhasLink(java.lang.String rel)Returns whether the resource contains aLinkwith the given rel.booleanhasLinks()Returns whether the resource containsLinks at all.voidremoveLinks()Removes allLinks added to the resource so far.voidsetRemoteStatus(RemoteStatus status)Set theRemoteStatusfor this object if it was read from a remote sourcejava.lang.StringtoString()
-
-
-
Method Detail
-
add
public void add(org.springframework.hateoas.Link link)
Adds the given link to the resource.- Parameters:
link- The link to add to the resource
-
add
public void add(java.lang.Iterable<org.springframework.hateoas.Link> links)
Adds all givenLinks to the resource.- Parameters:
links- The list of links to add to the resource
-
hasLinks
public boolean hasLinks()
Returns whether the resource containsLinks at all.- Returns:
- true/false whether the resource contains the link
-
hasLink
public boolean hasLink(java.lang.String rel)
Returns whether the resource contains aLinkwith the given rel.- Parameters:
rel- The rel name to test- Returns:
- true/false if it has a link with the given rel
-
getLinks
public java.util.List<org.springframework.hateoas.Link> getLinks()
Returns allLinks contained in this resource.- Returns:
- The list of links for this resource
-
removeLinks
public void removeLinks()
Removes allLinks added to the resource so far.
-
getLink
public java.util.Optional<org.springframework.hateoas.Link> getLink(java.lang.String rel)
Returns the link with the given rel.- Parameters:
rel- the String rel to get a link for- Returns:
- the link with the given rel or null if none found.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getSelfHref
public java.lang.String getSelfHref()
Convenience method for getting the self rel href for an object read from a remote site- Returns:
- String href if available, null otherwise
-
setRemoteStatus
public void setRemoteStatus(RemoteStatus status)
Set theRemoteStatusfor this object if it was read from a remote source- Parameters:
status- theRemoteStatusobject
-
getRemoteStatus
public RemoteStatus getRemoteStatus()
Get theRemoteStatusfor this object if it was read from a remote source- Returns:
- a
RemoteStatus
-
-