Class ApplicationAction


  • public class ApplicationAction
    extends RestAction<Application>
    Extension of RestAction specifically designed to create a Application. This extension allows setting properties before executing the action.
    Since:
    3.0
    Author:
    Aljoscha Grebe
    • Constructor Detail

      • ApplicationAction

        public ApplicationAction​(net.dv8tion.jda.core.entities.impl.JDAImpl api,
                                 java.lang.String name)
    • 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 to false 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 class RestAction<Application>
        Parameters:
        checks - The checks to run before executing the request, or null to run no checks
        Returns:
        The current RestAction for chaining convenience
      • setDescription

        public ApplicationAction setDescription​(java.lang.String description)
        Sets the description for the new Application. Passing null or an empty String will reset the description.

        A description must not be than 400 characters long!

        Parameters:
        description - The description for new Application
        Returns:
        The current ApplicationAction for chaining
        Throws:
        java.lang.IllegalArgumentException - If the provided description is more than 400 characters long
      • setName

        public ApplicationAction setName​(java.lang.String name)
        Sets the name for the new Application.

        A name must not be null nor less than 2 characters or more than 32 characters long!

        Parameters:
        name - The name for new Application
        Returns:
        The current ApplicationAction for chaining
        Throws:
        java.lang.IllegalArgumentException - If the provided name is null, less than 2 or more than 32 characters long