Package net.dv8tion.jda.api.managers
Interface TemplateManager
-
- All Superinterfaces:
AuditableRestAction<java.lang.Void>
,Manager<TemplateManager>
,RestAction<java.lang.Void>
public interface TemplateManager extends Manager<TemplateManager>
Manager providing functionality to update one or more fields for aTemplate
.Example
manager.setName("backup") .setDescription("backup for our server") .queue(); manager.reset(TemplateManager.DESCRIPTION | TemplateManager.NAME) .setName("server template") .setDescription(null) .queue();
- See Also:
Template.getManager()
-
-
Field Summary
Fields Modifier and Type Field Description static long
DESCRIPTION
Used to reset the description fieldstatic long
NAME
Used to reset the name field
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TemplateManager
reset(long fields)
Resets the fields specified by the provided bit-flag pattern.TemplateManager
reset(long... fields)
Resets the fields specified by the provided bit-flag patterns.TemplateManager
setDescription(java.lang.String description)
Sets the description of thisTemplate
.TemplateManager
setName(java.lang.String name)
Sets the name of thisTemplate
.-
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
-
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
-
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
-
-
-
Field Detail
-
NAME
static final long NAME
Used to reset the name field- See Also:
- Constant Field Values
-
DESCRIPTION
static final long DESCRIPTION
Used to reset the description field- See Also:
- Constant Field Values
-
-
Method Detail
-
reset
@Nonnull TemplateManager 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(TemplateManager.NAME | TemplateManager.DESCRIPTION);
Flag Constants:
- Specified by:
reset
in interfaceManager<TemplateManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- TemplateManager for chaining convenience
-
reset
@Nonnull TemplateManager reset(long... fields)
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(TemplateManager.NAME, TemplateManager.DESCRIPTION);
Flag Constants:
- Specified by:
reset
in interfaceManager<TemplateManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- TemplateManager for chaining convenience
-
setName
@Nonnull @CheckReturnValue TemplateManager setName(@Nonnull java.lang.String name)
Sets the name of thisTemplate
.- Parameters:
name
- The new name for thisTemplate
- Returns:
- TemplateManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided name isnull
or not between 1-100 characters long
-
setDescription
@Nonnull @CheckReturnValue TemplateManager setDescription(@Nullable java.lang.String description)
Sets the description of thisTemplate
.- Parameters:
description
- The new description for thisTemplate
- Returns:
- TemplateManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided description is not between 0-120 characters long
-
-