Record Class AutoCompleteDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.AutoCompleteDefinition
- Record Components:
classDescription
- theClassDescription
of the declaring class of themethodDescription()
methodDescription
- theMethodDescription
of the method this definition is bound tocommands
- the commands this autocomplete handler can handle
- All Implemented Interfaces:
Definition
,Invokable
,InteractionDefinition
public record AutoCompleteDefinition(@NotNull ClassDescription classDescription, @NotNull MethodDescription methodDescription, @NotNull Set<String> commands)
extends Record
implements InteractionDefinition
Representation of an auto complete handler.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.kaktushose.jda.commands.definitions.interactions.InteractionDefinition
InteractionDefinition.ReplyConfig
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionAutoCompleteDefinition
(@NotNull ClassDescription classDescription, @NotNull MethodDescription methodDescription, @NotNull Set<String> commands) Creates an instance of aAutoCompleteDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Optional
<AutoCompleteDefinition> build
(@NotNull ClassDescription clazz, @NotNull MethodDescription method) Builds a newAutoCompleteDefinition
from the given class and method description.@NotNull ClassDescription
Returns the value of theclassDescription
record component.commands()
Returns the value of thecommands
record component.@NotNull String
The human-readable name of this definition.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull MethodDescription
Returns the value of themethodDescription
record component.@NotNull Collection
<String> A possibly-emptyCollection
of permissions for this interaction.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.kaktushose.jda.commands.definitions.interactions.InteractionDefinition
definitionId, newInstance, replyConfig
-
Constructor Details
-
AutoCompleteDefinition
public AutoCompleteDefinition(@NotNull @NotNull ClassDescription classDescription, @NotNull @NotNull MethodDescription methodDescription, @NotNull @NotNull Set<String> commands) Creates an instance of aAutoCompleteDefinition
record class.- Parameters:
classDescription
- the value for theclassDescription
record componentmethodDescription
- the value for themethodDescription
record componentcommands
- the value for thecommands
record component
-
-
Method Details
-
build
@NotNull public static @NotNull Optional<AutoCompleteDefinition> build(@NotNull @NotNull ClassDescription clazz, @NotNull @NotNull MethodDescription method) Builds a newAutoCompleteDefinition
from the given class and method description.- Parameters:
clazz
- the correspondingClassDescription
method
- the correspondingMethodDescription
- Returns:
- an
Optional
holding theAutoCompleteDefinition
-
displayName
Description copied from interface:Definition
The human-readable name of this definition.- Specified by:
displayName
in interfaceDefinition
-
permissions
Description copied from interface:InteractionDefinition
A possibly-emptyCollection
of permissions for this interaction.- Specified by:
permissions
in interfaceInteractionDefinition
-
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 theclassDescription
record component.- Specified by:
classDescription
in interfaceInvokable
- Returns:
- the value of the
classDescription
record component
-
methodDescription
Returns the value of themethodDescription
record component.- Specified by:
methodDescription
in interfaceInvokable
- Returns:
- the value of the
methodDescription
record component
-
commands
-