Class ChecksumsInfo

  • All Implemented Interfaces:
    java.io.Serializable

    public class ChecksumsInfo
    extends java.lang.Object
    implements java.io.Serializable
    A container class to manage a collection of checksums, with isIdentical and other equals, hashCode goodies.
    Author:
    Yoav Landman, Fred Simon
    See Also:
    Serialized Form
    • Constructor Detail

      • ChecksumsInfo

        public ChecksumsInfo()
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • size

        public int size()
      • getMd5

        public java.lang.String getMd5()
        Returns:
        The actual MD5 checksum or null if not found
      • getSha1

        public java.lang.String getSha1()
        Returns:
        The actual SHA1 checksum or null if not found
      • getSha256

        public java.lang.String getSha256()
        Returns:
        The actual SHA256 checksum or null if not found
      • setChecksums

        public void setChecksums​(java.util.Set<ChecksumInfo> checksums)
      • getChecksums

        public java.util.Set<ChecksumInfo> getChecksums()
      • addChecksumInfo

        public void addChecksumInfo​(ChecksumInfo checksumInfo)
        Adds new checksum info. If checksum of the same type already exists it will be overridden.
        Parameters:
        checksumInfo - The checksum info to add
      • createTrustedChecksums

        public void createTrustedChecksums()
        Replaces all checksums with null checksum values that are marked as trusted by Artifactory.

        For internal use only.

      • isIdentical

        public boolean isIdentical​(ChecksumsInfo info)
        Compares checksums by type and values.
      • equals

        public boolean equals​(java.lang.Object o)
        Compares checksums by type only.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object