public class AccountManager
extends java.lang.Object
AccountManagerUpdatable
instance.
This decoration allows to modify a single field by automatically building an update RestAction
Constructor and Description |
---|
AccountManager(SelfUser selfUser)
Creates a new AccountManager instance
|
Modifier and Type | Method and Description |
---|---|
JDA |
getJDA()
The
JDA instance of this AccountManager |
SelfUser |
getSelfUser()
The
SelfUser that will be
modified by this AccountManager. |
RestAction<java.lang.Void> |
setAvatar(Icon avatar)
Sets the avatar for the currently logged in account
More information can be found here ! |
RestAction<java.lang.Void> |
setAvatar(Icon avatar,
java.lang.String currentPassword)
Sets the avatar for the currently logged in account
More information can be found here ! |
RestAction<java.lang.Void> |
setEmail(java.lang.String email,
java.lang.String currentPassword)
Sets the email for the currently logged in client account.
|
RestAction<java.lang.Void> |
setName(java.lang.String name)
Sets the username for the currently logged in account
More information can be found here ! |
RestAction<java.lang.Void> |
setName(java.lang.String name,
java.lang.String currentPassword)
Sets the username for the currently logged in account
More information can be found here ! |
RestAction<java.lang.Void> |
setPassword(java.lang.String newPassword,
java.lang.String currentPassword)
Sets the password for the currently logged in client account.
|
public JDA getJDA()
JDA
instance of this AccountManagerpublic SelfUser getSelfUser()
SelfUser
that will be
modified by this AccountManager.
@CheckReturnValue public RestAction<java.lang.Void> setName(java.lang.String name)
here
!
Client-Accounts (AccountType.CLIENT
) require the
current password to be updated. See setName(String, String)
name
- The new usernameRestAction
The update RestAction that will set the provided name.
#update()
for more informationjava.lang.IllegalArgumentException
- If the provided name is:
null
2
or more than 32
characters in length@CheckReturnValue public RestAction<java.lang.Void> setName(java.lang.String name, java.lang.String currentPassword)
here
!name
- The new usernamecurrentPassword
- The current password for the represented account,
this is only required for AccountType.CLIENT
RestAction
The update RestAction that will set the provided name.
#update()
for more informationjava.lang.IllegalArgumentException
- If this is action is performed on an account with the type CLIENT
and the provided password is null
or empty
null
@CheckReturnValue public RestAction<java.lang.Void> setAvatar(Icon avatar)
here
!
Client-Accounts (AccountType.CLIENT
) require the
current password to be updated. See #setAvatar(Icon, String)
avatar
- An Icon
instance representing
the new Avatar for the current account, null
to reset the avatar to the default avatar.RestAction
The update RestAction that will set the provided icon as the new avatar or reset the avatar.
#update()
for more information@CheckReturnValue public RestAction<java.lang.Void> setAvatar(Icon avatar, java.lang.String currentPassword)
here
!avatar
- An Icon
instance representing
the new Avatar for the current account, null
to reset the avatar to the default avatar.currentPassword
- The current password for the represented account,
this is only required for AccountType.CLIENT
RestAction
The update RestAction that will set the provided icon as the new avatar or reset the avatar.
#update()
for more informationjava.lang.IllegalArgumentException
- If the provided currentPassword
is null
or empty and the currently
logged in account is from AccountType.CLIENT
@CheckReturnValue public RestAction<java.lang.Void> setEmail(java.lang.String email, java.lang.String currentPassword)
here
!email
- The new emailcurrentPassword
- The valid current password for the represented accountRestAction
The update RestAction that will set the provided email.
#update()
for more informationAccountTypeException
- If the currently logged in account is not from AccountType.CLIENT
java.lang.IllegalArgumentException
- currentPassword
or the provided email
is null
or empty
email
is not valid.@CheckReturnValue public RestAction<java.lang.Void> setPassword(java.lang.String newPassword, java.lang.String currentPassword)
here
!newPassword
- The new password for the currently logged in accountcurrentPassword
- The valid current password for the represented accountRestAction
The update RestAction that will set the provided email.
#update()
for more informationAccountTypeException
- If the currently logged in account is not from AccountType.CLIENT
java.lang.IllegalArgumentException
- If any of the provided passwords are null
or empty