Interface AccountManager

All Superinterfaces:
AuditableRestAction<Void>, Manager<AccountManager>, RestAction<Void>

public interface AccountManager extends Manager<AccountManager>
Manager providing functionality to update one or more fields for the logged in account.

Example

manager.setAvatar(null).queue();
manager.reset(AccountManager.AVATAR)
       .setAvatar(icon)
       .queue();
See Also:
  • Field Details

  • Method Details

    • getSelfUser

      @Nonnull SelfUser getSelfUser()
      The SelfUser that will be modified by this AccountManager.
      This represents the currently logged in account.
      Returns:
      The corresponding SelfUser
    • reset

      @Nonnull @CheckReturnValue AccountManager reset(long fields)
      Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
      Example: manager.reset(AccountManager.NAME | AccountManager.AVATAR);

      Flag Constants:

      Specified by:
      reset in interface Manager<AccountManager>
      Parameters:
      fields - Integer value containing the flags to reset.
      Returns:
      AccountManager for chaining convenience
    • reset

      @Nonnull @CheckReturnValue AccountManager reset(@Nonnull long... fields)
      Resets the fields specified by the provided bit-flag patterns.
      Example: manager.reset(AccountManager.NAME, AccountManager.AVATAR);

      Flag Constants:

      Specified by:
      reset in interface Manager<AccountManager>
      Parameters:
      fields - Integer values containing the flags to reset.
      Returns:
      AccountManager for chaining convenience
    • setName

      @Nonnull @CheckReturnValue AccountManager setName(@Nonnull String name)
      Sets the username for the currently logged in account
      Parameters:
      name - The new username
      Returns:
      AccountManager for chaining convenience
      Throws:
      IllegalArgumentException - If the provided name is:
      • Equal to null
      • Less than 2 or more than 32 characters in length
    • setAvatar

      @Nonnull @CheckReturnValue AccountManager setAvatar(@Nullable Icon avatar)
      Sets the avatar for the currently logged in account
      Parameters:
      avatar - An Icon instance representing the new Avatar for the current account, null to reset the avatar to the default avatar.
      Returns:
      AccountManager for chaining convenience
    • setBanner

      @Nonnull @CheckReturnValue AccountManager setBanner(@Nullable Icon banner)
      Sets the banner for the currently logged in account
      Parameters:
      banner - An Icon instance representing the new banner for the current account, null to reset the banner to the default banner.
      Returns:
      AccountManager for chaining convenience