Class 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 for Blob implementations. This base class provides default implementations for hashCode and equals.
    • 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:
        getReference in interface org.apache.jackrabbit.oak.api.Blob
      • getContentIdentity

        public String getContentIdentity()
        Specified by:
        getContentIdentity in interface org.apache.jackrabbit.oak.api.Blob
      • equals

        public boolean equals​(Object other)
        To Blob instances are considered equal iff they have the same SHA-256 hash code are equal.
        Overrides:
        equals in class Object
        Parameters:
        other -
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object