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
public abstract class AbstractBlob extends Object implements org.apache.jackrabbit.oak.api.Blob
Abstract base class forBlobimplementations. This base class provides default implementations forhashCodeandequals.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBlob()protectedAbstractBlob(HashCode hashCode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HashCodecalculateSha256(org.apache.jackrabbit.oak.api.Blob blob)static booleanequal(org.apache.jackrabbit.oak.api.Blob a, org.apache.jackrabbit.oak.api.Blob b)booleanequals(Object other)ToBlobinstances are considered equal iff they have the same SHA-256 hash code are equal.StringgetContentIdentity()@Nullable StringgetReference()inthashCode()protected byte[]sha256()This hash code implementation returns the hash code of the underlying streamStringtoString()
-
-
-
Constructor Detail
-
AbstractBlob
protected AbstractBlob(HashCode hashCode)
-
AbstractBlob
protected AbstractBlob()
-
-
Method Detail
-
equal
public static boolean equal(org.apache.jackrabbit.oak.api.Blob a, org.apache.jackrabbit.oak.api.Blob b)
-
calculateSha256
public static 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
@Nullable public @Nullable String getReference()
- Specified by:
getReferencein interfaceorg.apache.jackrabbit.oak.api.Blob
-
getContentIdentity
public String getContentIdentity()
- Specified by:
getContentIdentityin interfaceorg.apache.jackrabbit.oak.api.Blob
-
equals
public boolean equals(Object other)
ToBlobinstances are considered equal iff they have the same SHA-256 hash code are equal.
-
-