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.Object
Adds a collection ofLink
s 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 void
add(java.lang.Iterable<org.springframework.hateoas.Link> links)
Adds all givenLink
s to the resource.void
add(org.springframework.hateoas.Link link)
Adds the given link to the resource.boolean
equals(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 allLink
s contained in this resource.RemoteStatus
getRemoteStatus()
Get theRemoteStatus
for this object if it was read from a remote sourcejava.lang.String
getSelfHref()
Convenience method for getting the self rel href for an object read from a remote siteint
hashCode()
boolean
hasLink(java.lang.String rel)
Returns whether the resource contains aLink
with the given rel.boolean
hasLinks()
Returns whether the resource containsLink
s at all.void
removeLinks()
Removes allLink
s added to the resource so far.void
setRemoteStatus(RemoteStatus status)
Set theRemoteStatus
for this object if it was read from a remote sourcejava.lang.String
toString()
-
-
-
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 givenLink
s to the resource.- Parameters:
links
- The list of links to add to the resource
-
hasLinks
public boolean hasLinks()
Returns whether the resource containsLink
s at all.- Returns:
- true/false whether the resource contains the link
-
hasLink
public boolean hasLink(java.lang.String rel)
Returns whether the resource contains aLink
with 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 allLink
s contained in this resource.- Returns:
- The list of links for this resource
-
removeLinks
public void removeLinks()
Removes allLink
s 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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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 theRemoteStatus
for this object if it was read from a remote source- Parameters:
status
- theRemoteStatus
object
-
getRemoteStatus
public RemoteStatus getRemoteStatus()
Get theRemoteStatus
for this object if it was read from a remote source- Returns:
- a
RemoteStatus
-
-