Class Sample

  • All Implemented Interfaces:
    ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifierHolder, ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder, java.io.Serializable

    @JsonObject("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
    • 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()