Enum Class CredentialKind

java.lang.Object
java.lang.Enum<CredentialKind>
lol.trq.alts.bulk.CredentialKind
All Implemented Interfaces:
Serializable, Comparable<CredentialKind>, Constable

public enum CredentialKind extends Enum<CredentialKind>
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
  • Enum Constant Details

    • REFRESH_TOKEN

      public static final CredentialKind REFRESH_TOKEN
      A Microsoft OAuth refresh token, possibly prefixed with a name or a bearer marker.
      Since:
      0.9.0
    • SESSION_TOKEN

      public static final CredentialKind SESSION_TOKEN
      A Minecraft services session token — a JWT.
      Since:
      0.9.0
    • OFFLINE_NAME

      public static final CredentialKind 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

      public static final CredentialKind UNKNOWN
      Something this cannot place. Never guessed at.
      Since:
      0.9.0
  • Method Details

    • values

      public static CredentialKind[] 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

      public static CredentialKind valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • detect

      public static CredentialKind detect(String entry)
      Decides what a line is.

      Checked most specific first, and anything left over is UNKNOWN rather 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