Record Class SlashCommandDefinition
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.command.SlashCommandDefinition
- Record Components:
classDescription- theClassDescriptionof the declaring class of themethodDescription()methodDescription- theMethodDescriptionof the method this definition is bound topermissions- aCollectionof permissions for this commandname- the name of the commandcommandConfig- theCommandDefinition.CommandConfigto usedescription- the command descriptioncommandOptions- aSequencedCollectionofOptionDataDefinitions
- All Implemented Interfaces:
Definition, Invokable, JDAEntity<CommandData>, CommandDefinition, InteractionDefinition
public record SlashCommandDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String name, CommandDefinition.CommandConfig commandConfig, String description, SequencedCollection<OptionDataDefinition> commandOptions)
extends Record
implements CommandDefinition
Representation of a slash command.
-
Nested Class Summary
Nested classes/interfaces inherited from interface CommandDefinition
CommandDefinition.CommandConfigNested classes/interfaces inherited from interface InteractionDefinition
InteractionDefinition.ReplyConfig -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSlashCommandDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String name, CommandDefinition.CommandConfig commandConfig, String description, SequencedCollection<OptionDataDefinition> commandOptions) Creates an instance of aSlashCommandDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SlashCommandDefinitionbuild(MethodBuildContext context) Builds a newSlashCommandDefinitionfrom the givenMethodBuildContext.Returns the value of theclassDescriptionrecord component.Returns the value of thecommandConfigrecord component.Returns the value of thecommandOptionsrecord component.TheCommand.Typeof this command.Returns the value of thedescriptionrecord component.The human-readable name of this definition.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themethodDescriptionrecord component.name()Returns the value of thenamerecord component.Returns the value of thepermissionsrecord component.Transforms this definition intoSlashCommandData.final StringtoString()Returns a string representation of this record class.toSubcommandData(String name) Transforms this definition intoSubcommandData.Methods inherited from interface InteractionDefinition
definitionId
-
Constructor Details
-
SlashCommandDefinition
public SlashCommandDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String name, CommandDefinition.CommandConfig commandConfig, String description, SequencedCollection<OptionDataDefinition> commandOptions) Creates an instance of aSlashCommandDefinitionrecord class.- Parameters:
classDescription- the value for theclassDescriptionrecord componentmethodDescription- the value for themethodDescriptionrecord componentpermissions- the value for thepermissionsrecord componentname- the value for thenamerecord componentcommandConfig- the value for thecommandConfigrecord componentdescription- the value for thedescriptionrecord componentcommandOptions- the value for thecommandOptionsrecord component
-
-
Method Details
-
build
Builds a newSlashCommandDefinitionfrom the givenMethodBuildContext.- Returns:
- an
Optionalholding theSlashCommandDefinition
-
toJDAEntity
Transforms this definition into
SlashCommandData.This does not set
CommandData.setLocalizationFunction(LocalizationFunction)!- Specified by:
toJDAEntityin interfaceJDAEntity<CommandData>- Returns:
- the
SlashCommandData
-
toSubcommandData
Transforms this definition intoSubcommandData.- Returns:
- the
SubcommandData
-
displayName
Description copied from interface:DefinitionThe human-readable name of this definition.- Specified by:
displayNamein interfaceDefinition
-
commandType
Description copied from interface:CommandDefinitionTheCommand.Typeof this command.- Specified by:
commandTypein interfaceCommandDefinition
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
classDescription
Returns the value of theclassDescriptionrecord component.- Specified by:
classDescriptionin interfaceInvokable- Returns:
- the value of the
classDescriptionrecord component
-
methodDescription
Returns the value of themethodDescriptionrecord component.- Specified by:
methodDescriptionin interfaceInvokable- Returns:
- the value of the
methodDescriptionrecord component
-
permissions
Returns the value of thepermissionsrecord component.- Specified by:
permissionsin interfaceInteractionDefinition- Returns:
- the value of the
permissionsrecord component
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceCommandDefinition- Returns:
- the value of the
namerecord component
-
commandConfig
Returns the value of thecommandConfigrecord component.- Specified by:
commandConfigin interfaceCommandDefinition- Returns:
- the value of the
commandConfigrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
commandOptions
Returns the value of thecommandOptionsrecord component.- Returns:
- the value of the
commandOptionsrecord component
-