Class InMemoryDataRecord
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.blob.datastore.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 booleanequals(java.lang.Object obj)DataIdentifiergetIdentifier()Returns the identifier of this record.static InMemoryDataRecordgetInstance(java.lang.String id)Convert a String to an instance of this class.longgetLastModified()Returns the last modified of the record.longgetLength()Returns the length of the binary stream in this record.java.lang.StringgetReference()Returns a secure reference to this binary, ornullif no such reference is available.java.io.InputStreamgetStream()Returns the the binary stream in this record.inthashCode()Returns zero to satisfy the Object equals/hashCode contract.static booleanisInstance(java.lang.String id)Checks if String can be converted to an instance of this class.java.lang.StringtoString()
-
-
-
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
-
getIdentifier
public DataIdentifier getIdentifier()
Description copied from interface:DataRecordReturns the identifier of this record.- Specified by:
getIdentifierin interfaceDataRecord- Returns:
- data identifier
-
getReference
public java.lang.String getReference()
Description copied from interface:DataRecordReturns a secure reference to this binary, ornullif no such reference is available.- Specified by:
getReferencein interfaceDataRecord- Returns:
- binary reference, or
null
-
getLength
public long getLength() throws DataStoreExceptionDescription copied from interface:DataRecordReturns the length of the binary stream in this record.- Specified by:
getLengthin interfaceDataRecord- Returns:
- length of the binary stream
- Throws:
DataStoreException- if the record could not be accessed
-
getStream
public java.io.InputStream getStream()
Description copied from interface:DataRecordReturns the the binary stream in this record.- Specified by:
getStreamin interfaceDataRecord- Returns:
- binary stream
-
getLastModified
public long getLastModified()
Description copied from interface:DataRecordReturns the last modified of the record.- Specified by:
getLastModifiedin interfaceDataRecord- Returns:
- last modified time of the binary stream
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.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:
hashCodein classjava.lang.Object- Returns:
- always zero
- See Also:
Object.hashCode()
-
-