Class AbstractBlob
- java.lang.Object
 - 
- org.apache.jackrabbit.oak.plugins.memory.AbstractBlob
 
 
- 
- All Implemented Interfaces:
 Blob
- Direct Known Subclasses:
 ArrayBasedBlob,StringBasedBlob
public abstract class AbstractBlob extends java.lang.Object implements Blob
Abstract base class forBlobimplementations. This base class provides default implementations forhashCodeandequals. 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.jackrabbit.guava.common.hash.HashCodecalculateSha256(Blob blob)static booleanequal(Blob a, Blob b)booleanequals(java.lang.Object other)ToBlobinstances are considered equal iff they have the same SHA-256 hash code are equal.java.lang.StringgetContentIdentity()A unique identifier of the content of this value.@Nullable java.lang.StringgetReference()Returns a secure reference to this blob, ornullif such a reference is not available.inthashCode()java.lang.StringtoString()- 
Methods inherited from interface org.apache.jackrabbit.oak.api.Blob
getNewStream, isInlined, length 
 - 
 
 - 
 
- 
- 
Method Detail
- 
calculateSha256
public static org.apache.jackrabbit.guava.common.hash.HashCode calculateSha256(Blob blob)
 
- 
getReference
@Nullable public @Nullable java.lang.String getReference()
Description copied from interface:BlobReturns a secure reference to this blob, ornullif such a reference is not available.- Specified by:
 getReferencein interfaceBlob- Returns:
 - binary reference, or 
null - See Also:
 - OAK-834
 
 
- 
getContentIdentity
public java.lang.String getContentIdentity()
Description copied from interface:BlobA unique identifier of the content of this value. Usually this is a message digest of the content (a cryptographically secure one-way hash). This allows to avoid processing large binary values multiple times.This method returns null if the identifier is unknown. The identifier may not always be available, for example if the value has not yet been saved or processed. Once an identifier is available, it will never change because values are immutable.
If two values have the same identifier, the content of the value is guaranteed to be the same. However it is not guaranteed that two values with the same content will return the same identifier.
The identifier is opaque, meaning it can have any format and size.
- Specified by:
 getContentIdentityin interfaceBlob- Returns:
 - the unique identifier or null
 
 
- 
equals
public boolean equals(java.lang.Object other)
ToBlobinstances are considered equal iff they have the same SHA-256 hash code are equal.- Overrides:
 equalsin classjava.lang.Object- Parameters:
 other-
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -