Class AbstractBlob
java.lang.Object
org.apache.jackrabbit.oak.plugins.memory.AbstractBlob
- All Implemented Interfaces:
org.apache.jackrabbit.oak.api.Blob
- Direct Known Subclasses:
ArrayBasedBlob,StringBasedBlob
Abstract base class for
Blob implementations.
This base class provides default implementations for
hashCode and equals.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractBlob(org.apache.jackrabbit.guava.common.hash.HashCode hashCode) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jackrabbit.guava.common.hash.HashCodecalculateSha256(org.apache.jackrabbit.oak.api.Blob blob) static booleanequal(org.apache.jackrabbit.oak.api.Blob a, org.apache.jackrabbit.oak.api.Blob b) booleanToBlobinstances are considered equal iff they have the same SHA-256 hash code are equal.@Nullable StringinthashCode()protected byte[]sha256()This hash code implementation returns the hash code of the underlying streamtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jackrabbit.oak.api.Blob
getNewStream, isInlined, length
-
Constructor Details
-
AbstractBlob
protected AbstractBlob(org.apache.jackrabbit.guava.common.hash.HashCode hashCode) -
AbstractBlob
protected AbstractBlob()
-
-
Method Details
-
equal
public static boolean equal(org.apache.jackrabbit.oak.api.Blob a, org.apache.jackrabbit.oak.api.Blob b) -
calculateSha256
public static org.apache.jackrabbit.guava.common.hash.HashCode calculateSha256(org.apache.jackrabbit.oak.api.Blob blob) -
sha256
protected byte[] sha256()This hash code implementation returns the hash code of the underlying stream- Returns:
- a byte array of the hash
-
getReference
- Specified by:
getReferencein interfaceorg.apache.jackrabbit.oak.api.Blob
-
getContentIdentity
- Specified by:
getContentIdentityin interfaceorg.apache.jackrabbit.oak.api.Blob
-
equals
ToBlobinstances are considered equal iff they have the same SHA-256 hash code are equal. -
hashCode
public int hashCode() -
toString
-