public class ApplicationManagerUpdatable
extends java.lang.Object
updatable
manager that allows
to modify role settings like the name
and the icon
.
This manager allows to modify multiple fields at once
by getting the ApplicationField
for specific
properties and setting or resetting their values; followed by a call of update()
!
The ApplicationManager
implementation
simplifies this process by giving simple setters that return the update
RestAction
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
URL_PATTERN |
Constructor and Description |
---|
ApplicationManagerUpdatable(net.dv8tion.jda.client.entities.impl.ApplicationImpl application) |
Modifier and Type | Method and Description |
---|---|
Application |
getApplication()
The
Application that will
be modified by this Manager instance |
ApplicationField<java.lang.String> |
getDescriptionField()
An
ApplicationField
for the description of the selected Application . |
ApplicationField<java.lang.Boolean> |
getDoesBotRequireCodeGrantField()
An
ApplicationField
for the code grant state of the selected Application's bot. |
ApplicationField<Icon> |
getIconField()
|
ApplicationField<java.lang.Boolean> |
getIsBotPublicField()
An
ApplicationField
for the public state of the selected Application's bot. |
JDA |
getJDA()
The
JDA instance of this Manager |
ApplicationField<java.lang.String> |
getNameField()
An
ApplicationField
for the name of the selected Application . |
ApplicationField<java.util.List<java.lang.String>> |
getRedirectUrisField()
An
ApplicationField
for the redirect uris of the selected Application . |
void |
reset()
Resets all
Fields
for this manager instance by calling Field.reset() sequentially
This is automatically called by update() |
RestAction<java.lang.Void> |
update()
Creates a new
RestAction instance
that will apply all changes that have been made to this manager instance (one per runtime per JDA instance). |
public ApplicationManagerUpdatable(net.dv8tion.jda.client.entities.impl.ApplicationImpl application)
public final Application getApplication()
Application
that will
be modified by this Manager instanceApplication
public final ApplicationField<java.lang.String> getDescriptionField()
ApplicationField
for the description of the selected Application
.
To set the value use setValue(String)
on the returned ApplicationField
instance.
A description must not be more than 400 characters long!
Otherwise Field.setValue(...)
will
throw an IllegalArgumentException
.
ApplicationField
- Type: String
public final ApplicationField<java.lang.Boolean> getDoesBotRequireCodeGrantField()
ApplicationField
for the code grant state of the selected Application's
bot.
To set the value use setValue(Boolean)
on the returned ApplicationField
instance.
A code grant state must not be null
!
Otherwise Field.setValue(...)
will
throw an IllegalArgumentException
.
ApplicationField
- Type: Boolean
public final ApplicationField<Icon> getIconField()
ApplicationField
for the Icon
of the selected
Application
.
To set the value use setValue(Icon)
on the returned ApplicationField
instance.
ApplicationField
- Type: Icon
public final ApplicationField<java.lang.Boolean> getIsBotPublicField()
ApplicationField
for the public state of the selected Application's
bot.
To set the value use setValue(Boolean)
on the returned ApplicationField
instance.
A public state must not be null
!
Otherwise Field.setValue(...)
will
throw an IllegalArgumentException
.
ApplicationField
- Type: Boolean
public final ApplicationField<java.lang.String> getNameField()
ApplicationField
for the name of the selected Application
.
To set the value use setValue(String)
on the returned ApplicationField
instance.
A name must not be null
nor less than 2 characters or more than 32 characters long!
Otherwise Field.setValue(...)
will
throw an IllegalArgumentException
.
ApplicationField
- Type: String
public final ApplicationField<java.util.List<java.lang.String>> getRedirectUrisField()
ApplicationField
for the redirect uris of the selected Application
.
To set the value use setValue(List)
on the returned ApplicationField
instance.
Modification to the provided List
after passing it to this ApplicationManagerUpdatable
will be ignored.
The List
as well as all redirect uris must not be null
!
Otherwise Field.setValue(...)
will
throw an IllegalArgumentException
.
ApplicationField
- Type: List<String>
public void reset()
Fields
for this manager instance by calling Field.reset()
sequentially
update()
@CheckReturnValue public RestAction<java.lang.Void> update()
RestAction
instance
that will apply all changes that have been made to this manager instance (one per runtime per JDA instance).
Before applying new changes it is recommended to call reset()
to reset previous changes.
This is automatically called if this method returns successfully.
RestAction
- Type: Void
Fields
have been modified. (EmptyRestAction
)