Package com.authlete.common.types
Enum UserCodeCharset
- java.lang.Object
-
- java.lang.Enum<UserCodeCharset>
-
- com.authlete.common.types.UserCodeCharset
-
- All Implemented Interfaces:
Serializable
,Comparable<UserCodeCharset>
public enum UserCodeCharset extends Enum<UserCodeCharset>
Character set for end-user verification codes (user_code
) in Device Flow.See "6.1. User Code Recommendations" in RFC 8628 OAuth 2.0 Device Authorization Grant for recommendations for user code values.
- Since:
- 2.43
- See Also:
- RFC 8628 OAuth 2.0 Device Authorization Grant
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserCodeCharset
getByValue(short value)
Find an instance of this enum by a value.String
getCharacters()
Get the characters in this characters set.short
getValue()
Get the integer representation of this enum instance.static UserCodeCharset[]
toArray(int bits)
static int
toBits(EnumSet<UserCodeCharset> set)
static EnumSet<UserCodeCharset>
toSet(int bits)
static EnumSet<UserCodeCharset>
toSet(UserCodeCharset[] array)
static UserCodeCharset
valueOf(String name)
Returns the enum constant of this type with the specified name.static UserCodeCharset[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BASE20
public static final UserCodeCharset BASE20
"BCDFGHJKLMNPQRSTVWXZ", 20 upper-case non-vowel characters.
-
NUMERIC
public static final UserCodeCharset NUMERIC
"0123456789", 10 digit characters from '0' to '9'.
-
-
Method Detail
-
values
public static UserCodeCharset[] 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 (UserCodeCharset c : UserCodeCharset.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UserCodeCharset 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
-
getValue
public short getValue()
Get the integer representation of this enum instance.
-
getByValue
public static UserCodeCharset getByValue(short value)
Find an instance of this enum by a value.- Parameters:
value
- The integer representation of the instance to find.- Returns:
- An instance of this enum, or
null
if not found.
-
getCharacters
public String getCharacters()
Get the characters in this characters set.- Returns:
- A string that contains characters in this character set.
-
toBits
public static int toBits(EnumSet<UserCodeCharset> set)
-
toArray
public static UserCodeCharset[] toArray(int bits)
-
toSet
public static EnumSet<UserCodeCharset> toSet(int bits)
-
toSet
public static EnumSet<UserCodeCharset> toSet(UserCodeCharset[] array)
-
-