Package com.authlete.common.types
Enum TokenType
- java.lang.Object
-
- java.lang.Enum<TokenType>
-
- com.authlete.common.types.TokenType
-
- All Implemented Interfaces:
Serializable
,Comparable<TokenType>
public enum TokenType extends Enum<TokenType>
Token types registered at OAuth URI of OAuth Parameters of IANA (Internet Assigned Numbers Authority).
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCESS_TOKEN
Token type URI for an OAuth 2.0 access token;"urn:ietf:params:oauth:token-type:access_token"
.ID_TOKEN
Token type URI for an ID Token;"urn:ietf:params:oauth:token-type:id_token"
.JWT
JSON Web Token (JWT) Token Type;"urn:ietf:params:oauth:token-type:jwt"
.REFRESH_TOKEN
Token type URI for an OAuth 2.0 refresh token;"urn:ietf:params:oauth:token-type:refresh_token"
.SAML1
Token type URI for a base64url-encoded SAML 1.1 assertion;"urn:ietf:params:oauth:token-type:saml1"
.SAML2
Token type URI for a base64url-encoded SAML 2.0 assertion;"urn:ietf:params:oauth:token-type:saml2"
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TokenType
getByValue(short value)
Find an instance of this enum by a value.short
getValue()
Get the integer representation of this enum instance.static TokenType
parse(String tokenType)
ConvertString
toTokenType
.static TokenType[]
toArray(int bits)
static int
toBits(EnumSet<TokenType> set)
static EnumSet<TokenType>
toSet(int bits)
static EnumSet<TokenType>
toSet(TokenType[] array)
String
toString()
static TokenType
valueOf(String name)
Returns the enum constant of this type with the specified name.static TokenType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
JWT
public static final TokenType JWT
JSON Web Token (JWT) Token Type;"urn:ietf:params:oauth:token-type:jwt"
.
-
ACCESS_TOKEN
public static final TokenType ACCESS_TOKEN
Token type URI for an OAuth 2.0 access token;"urn:ietf:params:oauth:token-type:access_token"
.
-
REFRESH_TOKEN
public static final TokenType REFRESH_TOKEN
Token type URI for an OAuth 2.0 refresh token;"urn:ietf:params:oauth:token-type:refresh_token"
.
-
ID_TOKEN
public static final TokenType ID_TOKEN
Token type URI for an ID Token;"urn:ietf:params:oauth:token-type:id_token"
.
-
SAML1
public static final TokenType SAML1
Token type URI for a base64url-encoded SAML 1.1 assertion;"urn:ietf:params:oauth:token-type:saml1"
.
-
SAML2
public static final TokenType SAML2
Token type URI for a base64url-encoded SAML 2.0 assertion;"urn:ietf:params:oauth:token-type:saml2"
.
-
-
Method Detail
-
values
public static TokenType[] 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 (TokenType c : TokenType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TokenType 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 TokenType 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.
-
parse
public static TokenType parse(String tokenType)
ConvertString
toTokenType
.- Parameters:
tokenType
- A token type. For example,"urn:ietf:params:oauth:token-type:access_token"
.- Returns:
TokenType
instance, ornull
.
-
toArray
public static TokenType[] toArray(int bits)
-
-