Top Description Fields Constructors Methods
io.rsocket.metadata

public final Enum WellKnownAuthType

extends Enum<WellKnownAuthType>
Class Inheritance
Imports
java.util.Arrays, .LinkedHashMap, .Map

Enumeration of Well Known Auth Types, as defined in the eponymous extension. Such auth types are used in composite metadata (which can include routing and/or tracing metadata). Per specification, identifiers are between 0 and 127 (inclusive).

Field Summary

Modifier and TypeField and Description
public static final WellKnownAuthType
private final byte
public static final WellKnownAuthType
private final String
pack-priv static final WellKnownAuthType[]
pack-priv static final Map<String, WellKnownAuthType>
public static final WellKnownAuthType
public static final WellKnownAuthType

Constructor Summary

AccessConstructor and Description
private
WellKnownAuthType(String str, byte identifier)

Method Summary

Modifier and TypeMethod and Description
public static WellKnownAuthType

Returns:

the WellKnownAuthType, 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.
fromIdentifier
(int
the looked up identifier
id
)

Find the WellKnownAuthType for the given identifier (as an int).

public static WellKnownAuthType

Returns:

the matching WellKnownAuthType, or UNPARSEABLE_AUTH_TYPE if none matches
fromString
(String
the looked up auth type
authType
)

Find the WellKnownAuthType for the given String representation.

public byte

Returns:

the byte identifier of the auth type, guaranteed to be positive or zero.
getIdentifier
()

public String

Returns:

the auth type represented as a String, which is made of US_ASCII compatible characters only
getString
()

public String
toString()

Overrides java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration.
public static WellKnownAuthType
public static WellKnownAuthType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

BEARERback to summary
public static final WellKnownAuthType BEARER
identifierback to summary
private final byte identifier
SIMPLEback to summary
public static final WellKnownAuthType SIMPLE
strback to summary
private final String str
TYPES_BY_AUTH_IDback to summary
pack-priv static final WellKnownAuthType[] TYPES_BY_AUTH_ID
TYPES_BY_AUTH_STRINGback to summary
pack-priv static final Map<String, WellKnownAuthType> TYPES_BY_AUTH_STRING
UNKNOWN_RESERVED_AUTH_TYPEback to summary
public static final WellKnownAuthType UNKNOWN_RESERVED_AUTH_TYPE
UNPARSEABLE_AUTH_TYPEback to summary
public static final WellKnownAuthType UNPARSEABLE_AUTH_TYPE

Constructor Detail

WellKnownAuthTypeback to summary
private WellKnownAuthType(String str, byte identifier)

Method Detail

fromIdentifierback to summary
public static WellKnownAuthType fromIdentifier(int id)

Find the 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.

Parameters
id:int

the looked up identifier

Returns:WellKnownAuthType

the WellKnownAuthType, 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.

fromStringback to summary
public static WellKnownAuthType fromString(String authType)

Find the WellKnownAuthType for the given String representation. If the representation is null or doesn't match a WellKnownAuthType, the UNPARSEABLE_AUTH_TYPE is returned.

Parameters
authType:String

the looked up auth type

Returns:WellKnownAuthType

the matching WellKnownAuthType, or UNPARSEABLE_AUTH_TYPE if none matches

getIdentifierback to summary
public byte getIdentifier()
Returns:byte

the byte identifier of the auth type, guaranteed to be positive or zero.

getStringback to summary
public String getString()
Returns:String

the auth type represented as a String, which is made of US_ASCII compatible characters only

toStringback to summary
public String toString()

Overrides java.lang.Enum.toString.

Doc from java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

Returns:String

the name of this enum constant

Annotations
@Override
See Also
getString()
valueOfback to summary
public static WellKnownAuthType valueOf(String name)
valuesback to summary
public static WellKnownAuthType[] values()