Package org.artifactory.checksum
Class ChecksumsInfo
- java.lang.Object
-
- org.artifactory.checksum.ChecksumsInfo
-
- All Implemented Interfaces:
java.io.Serializable
public class ChecksumsInfo extends java.lang.Object implements java.io.SerializableA 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 Summary
Constructors Constructor Description ChecksumsInfo()ChecksumsInfo(ChecksumsInfo other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChecksumInfo(ChecksumInfo checksumInfo)Adds new checksum info.voidcreateTrustedChecksums()Replaces all checksums with null checksum values that are marked as trusted by Artifactory.booleanequals(java.lang.Object o)Compares checksums by type only.ChecksumInfogetChecksumInfo(ChecksumType type)java.util.Set<ChecksumInfo>getChecksums()java.lang.StringgetMd5()java.lang.StringgetSha1()java.lang.StringgetSha256()inthashCode()booleanisEmpty()booleanisIdentical(ChecksumsInfo info)Compares checksums by type and values.voidsetChecksums(java.util.Set<ChecksumInfo> checksums)intsize()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ChecksumsInfo
public ChecksumsInfo()
-
ChecksumsInfo
public ChecksumsInfo(ChecksumsInfo other)
-
-
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()
-
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(java.lang.Object o)
Compares checksums by type only.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-