Class AltAccount.Builder

java.lang.Object
lol.trq.alts.model.AltAccount.Builder
Enclosing class:
AltAccount

public static final class AltAccount.Builder extends Object
Builds an AltAccount field by field. Every setter takes null (or 0) as "none", as the account's fields do. A builder is not thread-safe; the account it builds is immutable and takes its own copy of the bans.
Since:
1.0.0
  • Method Details

    • username

      public AltAccount.Builder username(String value)
      Sets the username.
      Parameters:
      value - the username
      Returns:
      this builder
      Since:
      1.0.0
    • accessToken

      public AltAccount.Builder accessToken(String value)
      Sets the access token.
      Parameters:
      value - the access token
      Returns:
      this builder
      Since:
      1.0.0
    • type

      public AltAccount.Builder type(AccountType value)
      Sets the account type.
      Parameters:
      value - the authentication protocol
      Returns:
      this builder
      Since:
      1.0.0
    • lastUsed

      public AltAccount.Builder lastUsed(long value)
      Sets the epoch-millis time of the last successful login.
      Parameters:
      value - the last-used time, or 0 for never
      Returns:
      this builder
      Since:
      1.0.0
    • lastUsedBy

      public AltAccount.Builder lastUsedBy(String value)
      Sets the member that last used the account in a shared repository.
      Parameters:
      value - the member id, or null
      Returns:
      this builder
      Since:
      1.0.0
    • bans

      public AltAccount.Builder bans(Map<String,BanInfo> value)
      Sets the ban records keyed by server id. The account takes its own copy when built.
      Parameters:
      value - the bans, or null for never observed banned
      Returns:
      this builder
      Since:
      1.0.0
    • sourceClient

      public AltAccount.Builder sourceClient(String value)
      Sets the client (mod) the alt was added from.
      Parameters:
      value - the source client, or null
      Returns:
      this builder
      Since:
      1.0.0
    • sourceUser

      public AltAccount.Builder sourceUser(String value)
      Sets the user within the source client that added the alt.
      Parameters:
      value - the source user, or null
      Returns:
      this builder
      Since:
      1.0.0
    • refreshToken

      public AltAccount.Builder refreshToken(String value)
      Sets the OAuth refresh token.
      Parameters:
      value - the refresh token, or null for none
      Returns:
      this builder
      Since:
      1.0.0
    • expiresAt

      public AltAccount.Builder expiresAt(long value)
      Sets the epoch-millis expiry of the access token.
      Parameters:
      value - the expiry, or 0 when unknown
      Returns:
      this builder
      Since:
      1.0.0
    • build

      public AltAccount build()
      Builds the account.
      Returns:
      a new immutable account
      Since:
      1.0.0