Enum Class ChecksumType

java.lang.Object
java.lang.Enum<ChecksumType>
org.artifactory.checksum.ChecksumType
All Implemented Interfaces:
Serializable, Comparable<ChecksumType>, Constable

public enum ChecksumType extends Enum<ChecksumType>
Author:
Yoav Landman
  • Enum Constant Details

  • Field Details

    • BASE_CHECKSUM_TYPES

      public static final List<ChecksumType> BASE_CHECKSUM_TYPES
  • Method Details

    • values

      public static ChecksumType[] 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

      public static ChecksumType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • alg

      public String alg()
    • ext

      public String 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

      public static ChecksumType forFilePath(String filePath)
      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

      public static ChecksumType forAlgorithm(String algorithm)
    • isValid

      public boolean isValid(String candidate)
      Parameters:
      candidate - Checksum candidate
      Returns:
      True if this string is a checksum value for this type
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ChecksumType>