Package net.dv8tion.jda.client.managers
Class ApplicationManager
- java.lang.Object
-
- net.dv8tion.jda.core.requests.RestAction<T>
-
- net.dv8tion.jda.core.requests.restaction.AuditableRestAction<java.lang.Void>
-
- net.dv8tion.jda.core.managers.impl.ManagerBase
-
- net.dv8tion.jda.client.managers.ApplicationManager
-
public class ApplicationManager extends net.dv8tion.jda.core.managers.impl.ManagerBase
Manager providing functionality to update one or more fields for anApplication
.Example
manager.setName("Yui") .setDescription("Simple but outdated bot") .queue(); manager.reset(ApplicationManager.NAME | ApplicationManager.PUBLIC) .setName("BooBot") .setDescription("Even more outdated bot") .queue();
- Since:
- 3.0
- Author:
- Aljoscha Grebe
- See Also:
Application.getManager()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.restaction.AuditableRestAction
AuditableRestAction.EmptyRestAction<T>
-
-
Field Summary
Fields Modifier and Type Field Description static long
CODE_GRANT
Used to reset the code grant fieldstatic long
DESCRIPTION
Used to reset the description fieldstatic long
ICON
Used to reset the icon fieldstatic long
NAME
Used to reset the name fieldstatic long
PUBLIC
Used to reset the public fieldstatic long
REDIRECT_URI
Used to reset the redirect uri field-
Fields inherited from class net.dv8tion.jda.core.requests.RestAction
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
-
-
Constructor Summary
Constructors Constructor Description ApplicationManager(net.dv8tion.jda.client.entities.impl.ApplicationImpl application)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Application
getApplication()
TheApplication
that will be modified by this Manager instanceApplicationManager
reset()
Resets all fields for this manager.ApplicationManager
reset(long fields)
Resets the fields specified by the provided bit-flag pattern.ApplicationManager
reset(long... fields)
Resets the fields specified by the provided bit-flag patterns.ApplicationManager
setDescription(java.lang.String description)
Sets the description of the selectedApplication
.ApplicationManager
setDoesBotRequireCodeGrant(boolean requireCodeGrant)
Sets the code grant state of the selectedApplication's
bot.ApplicationManager
setIcon(Icon icon)
Sets the icon of the selectedApplication
.ApplicationManager
setIsBotPublic(boolean botPublic)
Sets the public state of the selectedApplication's
bot.ApplicationManager
setName(java.lang.String name)
Sets the name of the selectedApplication
.ApplicationManager
setRedirectUris(java.util.List<java.lang.String> redirectUris)
Sets the redirect uris of the selectedApplication
.-
Methods inherited from class net.dv8tion.jda.core.managers.impl.ManagerBase
complete, isPermissionChecksEnabled, queue, setPermissionChecksEnabled
-
Methods inherited from class net.dv8tion.jda.core.requests.restaction.AuditableRestAction
reason, setCheck
-
Methods inherited from class net.dv8tion.jda.core.requests.RestAction
complete, completeAfter, getJDA, isPassContext, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
-
-
-
-
Field Detail
-
DESCRIPTION
public static final long DESCRIPTION
Used to reset the description field- See Also:
- Constant Field Values
-
ICON
public static final long ICON
Used to reset the icon field- See Also:
- Constant Field Values
-
NAME
public static final long NAME
Used to reset the name field- See Also:
- Constant Field Values
-
REDIRECT_URI
public static final long REDIRECT_URI
Used to reset the redirect uri field- See Also:
- Constant Field Values
-
PUBLIC
public static final long PUBLIC
Used to reset the public field- See Also:
- Constant Field Values
-
CODE_GRANT
public static final long CODE_GRANT
Used to reset the code grant field- See Also:
- Constant Field Values
-
-
Method Detail
-
getApplication
public Application getApplication()
TheApplication
that will be modified by this Manager instance- Returns:
- The
Application
-
reset
@CheckReturnValue public ApplicationManager 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(ApplicationManager.NAME | ApplicationManager.ROLES);
Flag Constants:
- Overrides:
reset
in classnet.dv8tion.jda.core.managers.impl.ManagerBase
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- ApplicationManager for chaining convenience
-
reset
@CheckReturnValue public ApplicationManager reset(long... fields)
Resets the fields specified by the provided bit-flag patterns. You can specify a combination by using a bitwise OR concat of the flag constants.
Example:manager.reset(ApplicationManager.NAME, ApplicationManager.ICON);
Flag Constants:
- Overrides:
reset
in classnet.dv8tion.jda.core.managers.impl.ManagerBase
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- ApplicationManager for chaining convenience
-
reset
@CheckReturnValue public ApplicationManager reset()
Resets all fields for this manager.- Returns:
- ApplicationManager for chaining convenience
-
setDescription
@CheckReturnValue public ApplicationManager setDescription(java.lang.String description)
Sets the description of the selectedApplication
.A description must not be longer than 400 characters long!
- Parameters:
description
- The new description for the selectedApplication
ornull
to reset- Returns:
- ApplicationManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided description is more than 400 characters long
-
setDoesBotRequireCodeGrant
@CheckReturnValue public ApplicationManager setDoesBotRequireCodeGrant(boolean requireCodeGrant)
Sets the code grant state of the selectedApplication's
bot.- Parameters:
requireCodeGrant
- The new state for the selectedApplication's
bot- Returns:
- ApplicationManager for chaining convenience
-
setIcon
@CheckReturnValue public ApplicationManager setIcon(Icon icon)
Sets the icon of the selectedApplication
.- Parameters:
icon
- The newIcon
for the selectedApplication
ornull
to reset- Returns:
- ApplicationManager for chaining convenience
-
setIsBotPublic
@CheckReturnValue public ApplicationManager setIsBotPublic(boolean botPublic)
Sets the public state of the selectedApplication's
bot.- Parameters:
botPublic
- The new state for the selectedApplication's
bot- Returns:
- ApplicationManager for chaining convenience
-
setName
@CheckReturnValue public ApplicationManager setName(java.lang.String name)
Sets the name of the selectedApplication
.A name must not be
null
nor less than 2 characters or more than 32 characters long!- Parameters:
name
- The new name for the selectedApplication
- Returns:
- ApplicationManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided name isnull
, less than 2 or more than 32 characters long
-
setRedirectUris
@CheckReturnValue public ApplicationManager setRedirectUris(java.util.List<java.lang.String> redirectUris)
Sets the redirect uris of the selectedApplication
.The redirect uris must not be
null
!- Parameters:
redirectUris
- The new redirect uris for the selectedApplication
ornull
to reset- Returns:
- ApplicationManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If one of the uris isnull
-
-