Class InMemoryDataRecord
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.blob.datastore.InMemoryDataRecord
-
- All Implemented Interfaces:
DataRecord
public class InMemoryDataRecord extends 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(Object obj)
DataIdentifier
getIdentifier()
Returns the identifier of this record.static InMemoryDataRecord
getInstance(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.String
getReference()
Returns a secure reference to this binary, ornull
if no such reference is available.InputStream
getStream()
Returns the the binary stream in this record.int
hashCode()
Returns zero to satisfy the Object equals/hashCode contract.static boolean
isInstance(String id)
Checks if String can be converted to an instance of this class.String
toString()
-
-
-
Method Detail
-
isInstance
public static boolean isInstance(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(String id) throws IllegalArgumentException
Convert a String to an instance of this class.- Parameters:
id
- DataRecord identifier- Returns:
- the instance
- Throws:
IllegalArgumentException
-
getIdentifier
public DataIdentifier getIdentifier()
Description copied from interface:DataRecord
Returns the identifier of this record.- Specified by:
getIdentifier
in interfaceDataRecord
- Returns:
- data identifier
-
getReference
public String getReference()
Description copied from interface:DataRecord
Returns a secure reference to this binary, ornull
if no such reference is available.- Specified by:
getReference
in interfaceDataRecord
- Returns:
- binary reference, or
null
-
getLength
public long getLength() throws DataStoreException
Description copied from interface:DataRecord
Returns the length of the binary stream in this record.- Specified by:
getLength
in interfaceDataRecord
- Returns:
- length of the binary stream
- Throws:
DataStoreException
- if the record could not be accessed
-
getStream
public InputStream getStream()
Description copied from interface:DataRecord
Returns the the binary stream in this record.- Specified by:
getStream
in interfaceDataRecord
- Returns:
- binary stream
-
getLastModified
public long getLastModified()
Description copied from interface:DataRecord
Returns the last modified of the record.- Specified by:
getLastModified
in interfaceDataRecord
- Returns:
- last modified time of the binary stream
-
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 classObject
- Returns:
- always zero
- See Also:
Object.hashCode()
-
-