Class SampleImmutable

    • Constructor Summary

      Constructors 
      Constructor Description
      SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample)
      Creates a new object that wraps the sample, which is assumed be an existing sample with all fetch options retrieved.
      SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample, boolean existingSample)
      Creates a new object that wraps the sample, which is assumed to have all fetch options retrieved.
      SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample, java.util.EnumSet<SampleFetchOption> retrievedFetchOptions)
      Creates a new object that wraps the sample, which is assumed be an existing sample.
      SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample, java.util.EnumSet<SampleFetchOption> retrievedFetchOptions, boolean existingSample)  
    • Constructor Detail

      • SampleImmutable

        public SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample)
        Creates a new object that wraps the sample, which is assumed be an existing sample with all fetch options retrieved.
        Parameters:
        sample - The sample to wrap.
      • SampleImmutable

        public SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample,
                               java.util.EnumSet<SampleFetchOption> retrievedFetchOptions)
        Creates a new object that wraps the sample, which is assumed be an existing sample.
        Parameters:
        sample - The sample to wrap.
        retrievedFetchOptions - The fetch options the sample includes.
      • SampleImmutable

        public SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample,
                               boolean existingSample)
        Creates a new object that wraps the sample, which is assumed to have all fetch options retrieved.
        Parameters:
        sample - The sample to wrap.
        existingSample - True if the sample exists in the DB.
      • SampleImmutable

        public SampleImmutable​(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample sample,
                               java.util.EnumSet<SampleFetchOption> retrievedFetchOptions,
                               boolean existingSample)
    • Method Detail

      • getId

        public java.lang.Long getId()
      • getSample

        public ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample getSample()
      • checkExists

        protected void checkExists()
        Throw an exception if the sample does not exist
      • getPropertyValue

        public java.lang.String getPropertyValue​(java.lang.String propertyCode)
        Description copied from interface: ISampleImmutable
        Return the value of a property specified by a code. May return null of no such property with code propertyCode is found.
        Specified by:
        getPropertyValue in interface ISampleImmutable
      • canGetContainedSamples

        public boolean canGetContainedSamples()
        Description copied from interface: ISampleImmutable
        Return true if this sample object has contained samples available. This is independent of whether or not the sample has contained samples. This method only says if the contained samples were provided to this object by the application server.
        Specified by:
        canGetContainedSamples in interface ISampleImmutable
      • hashCode

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

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