Class InMemoryDataRecord

  • All Implemented Interfaces:
    DataRecord

    public class InMemoryDataRecord
    extends java.lang.Object
    implements DataRecord
    Represents binary data which is backed by a byte[] (in memory).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      DataIdentifier getIdentifier()
      Returns the identifier of this record.
      static InMemoryDataRecord getInstance​(java.lang.String id)
      Convert a String to an instance of this class.
      long getLastModified()
      Returns the last modified of the record.
      long getLength()
      Returns the length of the binary stream in this record.
      java.lang.String getReference()
      Returns a secure reference to this binary, or null if no such reference is available.
      java.io.InputStream getStream()
      Returns the the binary stream in this record.
      int hashCode()
      Returns zero to satisfy the Object equals/hashCode contract.
      static boolean isInstance​(java.lang.String id)
      Checks if String can be converted to an instance of this class.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • isInstance

        public static boolean isInstance​(java.lang.String id)
        Checks if String can be converted to an instance of this class.
        Parameters:
        id - DataRecord identifier
        Returns:
        true if it can be converted
      • getInstance

        public static InMemoryDataRecord getInstance​(java.lang.String id)
                                              throws java.lang.IllegalArgumentException
        Convert a String to an instance of this class.
        Parameters:
        id - DataRecord identifier
        Returns:
        the instance
        Throws:
        java.lang.IllegalArgumentException
      • getReference

        public java.lang.String getReference()
        Description copied from interface: DataRecord
        Returns a secure reference to this binary, or null if no such reference is available.
        Specified by:
        getReference in interface DataRecord
        Returns:
        binary reference, or null
      • getStream

        public java.io.InputStream getStream()
        Description copied from interface: DataRecord
        Returns the the binary stream in this record.
        Specified by:
        getStream in interface DataRecord
        Returns:
        binary stream
      • getLastModified

        public long getLastModified()
        Description copied from interface: DataRecord
        Returns the last modified of the record.
        Specified by:
        getLastModified in interface DataRecord
        Returns:
        last modified time of the binary stream
      • toString

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

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

        public int hashCode()
        Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        always zero
        See Also:
        Object.hashCode()