Record Class ContextCommandDefinition
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.command.ContextCommandDefinition
- 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 commandcommandType- theCommand.Typeof this commandcommandConfig- theCommandDefinition.CommandConfigto use
- All Implemented Interfaces:
Definition, Invokable, JDAEntity<net.dv8tion.jda.api.interactions.commands.build.CommandData>, CommandDefinition, InteractionDefinition
public record ContextCommandDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String name, net.dv8tion.jda.api.interactions.commands.Command.Type commandType, CommandDefinition.CommandConfig commandConfig)
extends Record
implements CommandDefinition
Representation of a context 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
ConstructorsConstructorDescriptionContextCommandDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String name, net.dv8tion.jda.api.interactions.commands.Command.Type commandType, CommandDefinition.CommandConfig commandConfig) Creates an instance of aContextCommandDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContextCommandDefinitionbuild(MethodBuildContext context) Builds a newContextCommandDefinitionfrom the givenMethodBuildContext.Returns the value of theclassDescriptionrecord component.Returns the value of thecommandConfigrecord component.net.dv8tion.jda.api.interactions.commands.Command.TypeReturns the value of thecommandTyperecord 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.net.dv8tion.jda.api.interactions.commands.build.CommandDataTransforms this definition intoCommandData.final StringtoString()Returns a string representation of this record class.Methods inherited from interface InteractionDefinition
definitionId
-
Constructor Details
-
ContextCommandDefinition
public ContextCommandDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String name, net.dv8tion.jda.api.interactions.commands.Command.Type commandType, CommandDefinition.CommandConfig commandConfig) Creates an instance of aContextCommandDefinitionrecord class.- Parameters:
classDescription- the value for theclassDescriptionrecord componentmethodDescription- the value for themethodDescriptionrecord componentpermissions- the value for thepermissionsrecord componentname- the value for thenamerecord componentcommandType- the value for thecommandTyperecord componentcommandConfig- the value for thecommandConfigrecord component
-
-
Method Details
-
build
Builds a newContextCommandDefinitionfrom the givenMethodBuildContext.- Returns:
- an
Optionalholding theContextCommandDefinition
-
toJDAEntity
public net.dv8tion.jda.api.interactions.commands.build.CommandData toJDAEntity()Transforms this definition into
CommandData.This does not call
CommandData.setLocalizationFunction(LocalizationFunction)!- Specified by:
toJDAEntityin interfaceJDAEntity<net.dv8tion.jda.api.interactions.commands.build.CommandData>- Returns:
- the
CommandData
-
displayName
Description copied from interface:DefinitionThe human-readable name of this definition.- Specified by:
displayNamein interfaceDefinition
-
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
-
commandType
public net.dv8tion.jda.api.interactions.commands.Command.Type commandType()Returns the value of thecommandTyperecord component.- Specified by:
commandTypein interfaceCommandDefinition- Returns:
- the value of the
commandTyperecord component
-
commandConfig
Returns the value of thecommandConfigrecord component.- Specified by:
commandConfigin interfaceCommandDefinition- Returns:
- the value of the
commandConfigrecord component
-