Package org.eclipse.packager.rpm
Enum HashAlgorithm
- java.lang.Object
-
- java.lang.Enum<HashAlgorithm>
-
- org.eclipse.packager.rpm.HashAlgorithm
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<HashAlgorithm>
public enum HashAlgorithm extends java.lang.Enum<HashAlgorithm>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HashAlgorithmfrom(java.lang.String name)Get a hash algorithm from a stringjava.lang.StringgetId()intgetValue()static HashAlgorithmvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static HashAlgorithm[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SHA1
public static final HashAlgorithm SHA1
-
SHA256
public static final HashAlgorithm SHA256
-
SHA512
public static final HashAlgorithm SHA512
-
-
Method Detail
-
values
public static HashAlgorithm[] 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 (HashAlgorithm c : HashAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HashAlgorithm valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getValue
public int getValue()
-
getId
public java.lang.String getId()
-
from
public static HashAlgorithm from(java.lang.String name)
Get a hash algorithm from a stringThis method will return the hash algorithm as specified by the parameter "name". If this parameter is
nullor an empty string, then the default algorithmSHA1will be returned. If algorithm is an invalid name, then an exception is thrown.- Parameters:
name- the name of hash algorithm, ornull- Returns:
- a hash algorithm
- Throws:
java.lang.IllegalArgumentException- if the name was provided, but is invalid
-
-