public enum WellKnownAuthType extends Enum<WellKnownAuthType>
Enum Constant and Description |
---|
BEARER |
SIMPLE |
UNKNOWN_RESERVED_AUTH_TYPE |
UNPARSEABLE_AUTH_TYPE |
Modifier and Type | Method and Description |
---|---|
static WellKnownAuthType |
fromIdentifier(int id)
Find the
WellKnownAuthType for the given identifier (as an int ). |
static WellKnownAuthType |
fromString(String authType)
Find the
WellKnownAuthType for the given String representation. |
byte |
getIdentifier() |
String |
getString() |
String |
toString() |
static WellKnownAuthType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static WellKnownAuthType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final WellKnownAuthType UNPARSEABLE_AUTH_TYPE
public static final WellKnownAuthType UNKNOWN_RESERVED_AUTH_TYPE
public static final WellKnownAuthType SIMPLE
public static final WellKnownAuthType BEARER
public static WellKnownAuthType[] values()
for (WellKnownAuthType c : WellKnownAuthType.values()) System.out.println(c);
public static WellKnownAuthType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static WellKnownAuthType fromIdentifier(int id)
WellKnownAuthType
for the given identifier (as an int
). Valid
identifiers are defined to be integers between 0 and 127, inclusive. Identifiers outside of
this range will produce the UNPARSEABLE_AUTH_TYPE
. Additionally, some identifiers in
that range are still only reserved and don't have a type associated yet: this method returns
the UNKNOWN_RESERVED_AUTH_TYPE
when passing such an identifier, which lets call sites
potentially detect this and keep the original representation when transmitting the associated
metadata buffer.id
- the looked up identifierWellKnownAuthType
, or UNKNOWN_RESERVED_AUTH_TYPE
if the id is out
of the specification's range, or UNKNOWN_RESERVED_AUTH_TYPE
if the id is one that
is merely reserved but unknown to this implementation.public static WellKnownAuthType fromString(String authType)
WellKnownAuthType
for the given String
representation. If the
representation is null
or doesn't match a WellKnownAuthType
, the UNPARSEABLE_AUTH_TYPE
is returned.authType
- the looked up auth typeWellKnownAuthType
, or UNPARSEABLE_AUTH_TYPE
if none
matchespublic byte getIdentifier()
public String getString()
String
, which is made of US_ASCII compatible
characters onlypublic String toString()
toString
in class Enum<WellKnownAuthType>
getString()