Enum Class CredentialKind
- All Implemented Interfaces:
Serializable, Comparable<CredentialKind>, Constable
What one line of a pasted credential list appears to be.
Public because a host wants to show a user what it thinks it is about to import before running it, and because guessing wrong about a credential should be visible rather than silent.
- Since:
- 0.9.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionExported browser cookies, in any of the shapes the cookie route reads.A bare username, for an offline account.A Microsoft OAuth refresh token, possibly prefixed with a name or a bearer marker.A Minecraft services session token — a JWT.Something this cannot place. -
Method Summary
Modifier and TypeMethodDescriptionstatic CredentialKindDecides what a line is.static CredentialKindReturns the enum constant of this class with the specified name.static CredentialKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REFRESH_TOKEN
A Microsoft OAuth refresh token, possibly prefixed with a name or a bearer marker.- Since:
- 0.9.0
-
SESSION_TOKEN
A Minecraft services session token — a JWT.- Since:
- 0.9.0
-
COOKIE_TEXT
Exported browser cookies, in any of the shapes the cookie route reads.- Since:
- 0.9.0
-
OFFLINE_NAME
A bare username, for an offline account. Only a line that is a valid Minecraft name — three to sixteen letters, digits, or underscores — is taken for one.- Since:
- 0.9.0
-
UNKNOWN
Something this cannot place. Never guessed at.- Since:
- 0.9.0
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
detect
Decides what a line is.Checked most specific first, and anything left over is
UNKNOWNrather than assumed. Feeding a mistyped line to the wrong route produces a failure about the credential being bad, which sends the user looking in the wrong place.- Parameters:
entry- the line to classify- Returns:
- what it appears to be
- Since:
- 0.9.0
-