Record Class AutoCompleteDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.AutoCompleteDefinition
- Record Components:
clazzDescription
- 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
,com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
,InteractionDefinition
public record AutoCompleteDefinition(@NotNull ClassDescription clazzDescription, @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
Fields inherited from interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
log
-
Constructor Summary
ConstructorDescriptionAutoCompleteDefinition
(@NotNull ClassDescription clazzDescription, @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 theclazzDescription
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
Methods inherited from interface com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
invoke
-
Constructor Details
-
AutoCompleteDefinition
public AutoCompleteDefinition(@NotNull @NotNull ClassDescription clazzDescription, @NotNull @NotNull MethodDescription methodDescription, @NotNull @NotNull Set<String> commands) Creates an instance of aAutoCompleteDefinition
record class.- Parameters:
clazzDescription
- the value for theclazzDescription
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)
. -
clazzDescription
Returns the value of theclazzDescription
record component.- Specified by:
clazzDescription
in interfacecom.github.kaktushose.jda.commands.definitions.features.internal.Invokable
- Returns:
- the value of the
clazzDescription
record component
-
methodDescription
Returns the value of themethodDescription
record component.- Specified by:
methodDescription
in interfacecom.github.kaktushose.jda.commands.definitions.features.internal.Invokable
- Returns:
- the value of the
methodDescription
record component
-
commands
-