Package org.artifactory.checksum
Enum Class ChecksumType
- All Implemented Interfaces:
Serializable
,Comparable<ChecksumType>
,Constable
- Author:
- Yoav Landman
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionalg()
ext()
static ChecksumType
forAlgorithm
(String algorithm) static ChecksumType
forFilePath
(String filePath) boolean
int
length()
toString()
static ChecksumType
Returns the enum constant of this class with the specified name.static ChecksumType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
sha1
-
md5
-
sha256
-
-
Field Details
-
BASE_CHECKSUM_TYPES
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
alg
-
ext
- Returns:
- The filename extension of the checksum, including the dot prefix.
-
length
public int length()- Returns:
- The length of a valid checksum for this checksum type.
-
forFilePath
- Parameters:
filePath
- The checksum file path (assumed to end with the checksum extension).- Returns:
- Checksum type for the given file path. Null if not found.
-
forAlgorithm
-
isValid
- Parameters:
candidate
- Checksum candidate- Returns:
- True if this string is a checksum value for this type
-
toString
- Overrides:
toString
in classEnum<ChecksumType>
-