Class ChecksumsInfo

java.lang.Object
org.artifactory.checksum.ChecksumsInfo
All Implemented Interfaces:
Serializable

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

    • ChecksumsInfo

      public ChecksumsInfo()
    • ChecksumsInfo

      public ChecksumsInfo(ChecksumsInfo other)
  • Method Details

    • isEmpty

      public boolean isEmpty()
    • size

      public int size()
    • getMd5

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

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

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

      public void setChecksums(Set<ChecksumInfo> checksums)
    • getChecksums

      public Set<ChecksumInfo> getChecksums()
    • getChecksumInfo

      public ChecksumInfo getChecksumInfo(ChecksumType type)
    • 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(Object o)
      Compares checksums by type only.
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object