ch.systemsx.cisd.openbis.generic.shared.api.v1.dto
Class Sample

java.lang.Object
  extended by ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample
All Implemented Interfaces:
ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifierHolder, ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder, java.io.Serializable

@JsonObject(value="Sample")
public final class Sample
extends java.lang.Object
implements java.io.Serializable, ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifierHolder, ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder

Immutable value object representing a sample.

See Also:
Serialized Form

Nested Class Summary
static class Sample.SampleInitializer
          Class used to initialize a new sample instance.
 
Constructor Summary
Sample(Sample.SampleInitializer initializer)
          Creates a new instance with the provided initializer
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.List<Sample> getChildren()
          Return the children.
 java.util.List<Sample> getChildrenJson()
           
 java.lang.String getCode()
          Returns the sample code.
 java.lang.String getExperimentIdentifierOrNull()
           
 java.lang.Long getId()
          Returns the sample id.
 java.lang.String getIdentifier()
          Returns the sample identifier;
 java.util.List<ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject> getMetaprojects()
           
 java.util.List<ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject> getMetaprojectsJson()
           
 java.util.List<Sample> getParents()
          Return the parents.
 java.util.List<Sample> getParentsJson()
           
 java.lang.String getPermId()
          Returns the sample permanent id.
 java.util.Map<java.lang.String,java.lang.String> getProperties()
           
 java.util.Map<java.lang.String,java.lang.String> getPropertiesJson()
           
 EntityRegistrationDetails getRegistrationDetails()
          Return the sample registration details.
 java.util.EnumSet<SampleFetchOption> getRetrievedFetchOptions()
          Returns fetch options used to retrieved this sample object.
 java.lang.String getSampleTypeCode()
          Returns the sample type code.
 java.lang.Long getSampleTypeId()
          Returns the sample type id.
 java.lang.String getSpaceCode()
          Returns the space code.
 int hashCode()
           
 boolean isStub()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sample

public Sample(Sample.SampleInitializer initializer)
Creates a new instance with the provided initializer

Throws:
java.lang.IllegalArgumentException - if some of the required information is not provided.
Method Detail

getId

public java.lang.Long getId()
Returns the sample id.

Specified by:
getId in interface ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder

getSpaceCode

public java.lang.String getSpaceCode()
Returns the space code.


getPermId

public java.lang.String getPermId()
Returns the sample permanent id.


getCode

public java.lang.String getCode()
Returns the sample code.


getIdentifier

public java.lang.String getIdentifier()
Returns the sample identifier;

Specified by:
getIdentifier in interface ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifierHolder

getExperimentIdentifierOrNull

public java.lang.String getExperimentIdentifierOrNull()

getSampleTypeId

public java.lang.Long getSampleTypeId()
Returns the sample type id.


getSampleTypeCode

public java.lang.String getSampleTypeCode()
Returns the sample type code.


getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()
                                                               throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getMetaprojects

public java.util.List<ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject> getMetaprojects()
                                                                                              throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getRegistrationDetails

public EntityRegistrationDetails getRegistrationDetails()
Return the sample registration details.

Since:
1.11

getRetrievedFetchOptions

public java.util.EnumSet<SampleFetchOption> getRetrievedFetchOptions()
Returns fetch options used to retrieved this sample object.


getChildren

public java.util.List<Sample> getChildren()
                                   throws java.lang.IllegalArgumentException
Return the children.

Returns:
Children of this sample or an empty list if there are no children.
Throws:
java.lang.IllegalArgumentException - Thrown if the children were not retrieved from the server.

getParents

public java.util.List<Sample> getParents()
                                  throws java.lang.IllegalArgumentException
Return the parents.

Returns:
All parents of this sample or an empty list if there are no parents.
Throws:
java.lang.IllegalArgumentException - Thrown if the parents were not retrieved from the server.

isStub

public boolean isStub()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPropertiesJson

public java.util.Map<java.lang.String,java.lang.String> getPropertiesJson()

getMetaprojectsJson

public java.util.List<ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject> getMetaprojectsJson()

getChildrenJson

public java.util.List<Sample> getChildrenJson()

getParentsJson

public java.util.List<Sample> getParentsJson()