Class ApplicationAction
- java.lang.Object
-
- net.dv8tion.jda.core.requests.RestAction<Application>
-
- net.dv8tion.jda.client.requests.restaction.ApplicationAction
-
public class ApplicationAction extends RestAction<Application>
Extension ofRestAction
specifically designed to create aApplication
. This extension allows setting properties before executing the action.- Since:
- 3.0
- Author:
- Aljoscha Grebe
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.RestAction
RestAction.EmptyRestAction<T>
-
-
Field Summary
-
Fields inherited from class net.dv8tion.jda.core.requests.RestAction
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
-
-
Constructor Summary
Constructors Constructor Description ApplicationAction(net.dv8tion.jda.core.entities.impl.JDAImpl api, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationAction
setCheck(java.util.function.BooleanSupplier checks)
Sets the last-second checks before finally executing the http request in the queue.ApplicationAction
setDescription(java.lang.String description)
Sets the description for the newApplication
.ApplicationAction
setIcon(Icon icon)
Sets theIcon
of the selectedApplication
.ApplicationAction
setName(java.lang.String name)
Sets the name for the newApplication
.-
Methods inherited from class net.dv8tion.jda.core.requests.RestAction
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
-
-
-
-
Method Detail
-
setCheck
public ApplicationAction setCheck(java.util.function.BooleanSupplier checks)
Description copied from class:RestAction
Sets the last-second checks before finally executing the http request in the queue.
If the provided supplier evaluates tofalse
or throws an exception this will not be finished. When an exception is thrown from the supplier it will be provided to the failure callback.- Overrides:
setCheck
in classRestAction<Application>
- Parameters:
checks
- The checks to run before executing the request, ornull
to run no checks- Returns:
- The current RestAction for chaining convenience
-
setDescription
public ApplicationAction setDescription(java.lang.String description)
Sets the description for the newApplication
. Passingnull
or an emptyString
will reset the description.A description must not be than 400 characters long!
- Parameters:
description
- The description for newApplication
- Returns:
- The current ApplicationAction for chaining
- Throws:
java.lang.IllegalArgumentException
- If the provided description is more than 400 characters long
-
setIcon
public ApplicationAction setIcon(Icon icon)
Sets theIcon
of the selectedApplication
.- Parameters:
icon
- TheIcon
for newApplication
- Returns:
- The current ApplicationAction for chaining
-
setName
public ApplicationAction setName(java.lang.String name)
Sets the name for the newApplication
.A name must not be
null
nor less than 2 characters or more than 32 characters long!- Parameters:
name
- The name for newApplication
- Returns:
- The current ApplicationAction for chaining
- Throws:
java.lang.IllegalArgumentException
- If the provided name isnull
, less than 2 or more than 32 characters long
-
-