Package org.fcrepo.config
Enum DigestAlgorithm
- java.lang.Object
-
- java.lang.Enum<DigestAlgorithm>
-
- org.fcrepo.config.DigestAlgorithm
-
- All Implemented Interfaces:
Serializable
,Comparable<DigestAlgorithm>
public enum DigestAlgorithm extends Enum<DigestAlgorithm>
Digest Algorith enum- Author:
- cbeer Moved to its own class for Fedora 6.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DigestAlgorithm
fromAlgorithm(String alg)
Return enum value for the provided algorithmstatic DigestAlgorithm
fromScheme(String argScheme)
Return enum value for the provided scheme (e.g.String
getAlgorithm()
Set<String>
getAliases()
static String
getScheme(String alg)
Return the scheme associated with the provided algorithm (e.g.static boolean
isSupportedAlgorithm(String alg)
Return true if the provided algorithm is included in this enumstatic DigestAlgorithm
valueOf(String name)
Returns the enum constant of this type with the specified name.static DigestAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SHA1
public static final DigestAlgorithm SHA1
-
SHA256
public static final DigestAlgorithm SHA256
-
SHA512
public static final DigestAlgorithm SHA512
-
SHA512256
public static final DigestAlgorithm SHA512256
-
MD5
public static final DigestAlgorithm MD5
-
MISSING
public static final DigestAlgorithm MISSING
-
-
Method Detail
-
values
public static DigestAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DigestAlgorithm c : DigestAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DigestAlgorithm valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getScheme
public static String getScheme(String alg)
Return the scheme associated with the provided algorithm (e.g. SHA-1 returns urn:sha1)- Parameters:
alg
- for which scheme is requested- Returns:
- scheme
-
fromScheme
public static DigestAlgorithm fromScheme(String argScheme)
Return enum value for the provided scheme (e.g. urn:sha1 returns SHA-1)- Parameters:
argScheme
- for which enum is requested- Returns:
- enum value associated with the arg scheme
-
fromAlgorithm
public static DigestAlgorithm fromAlgorithm(String alg)
Return enum value for the provided algorithm- Parameters:
alg
- algorithm name to seek- Returns:
- enum value associated with the algorithm name, or missing if not found
-
isSupportedAlgorithm
public static boolean isSupportedAlgorithm(String alg)
Return true if the provided algorithm is included in this enum- Parameters:
alg
- to test- Returns:
- true if arg algorithm is supported
-
getAliases
public Set<String> getAliases()
- Returns:
- the aliases
-
getAlgorithm
public String getAlgorithm()
- Returns:
- the algorithm
-
-