Record Class ButtonDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.component.ButtonDefinition
- Record Components:
clazzDescription
- theClassDescription
of the declaring class of themethodDescription()
methodDescription
- theMethodDescription
of the method this definition is bound topermissions
- aCollection
of permissions for this buttonlabel
- the label of this buttonemoji
- theEmoji
of this button ornull
link
- the link of this button ornull
style
- theButtonStyle
of this button
- All Implemented Interfaces:
Definition
,CustomIdJDAEntity<Button>
,com.github.kaktushose.jda.commands.definitions.features.internal.Invokable
,JDAEntity<Button>
,ComponentDefinition<Button>
,InteractionDefinition
public record ButtonDefinition(@NotNull ClassDescription clazzDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull String label, @Nullable Emoji emoji, @Nullable String link, @NotNull ButtonStyle style)
extends Record
implements ComponentDefinition<Button>
Representation of a button.
-
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
ConstructorDescriptionButtonDefinition
(@NotNull ClassDescription clazzDescription, @NotNull MethodDescription methodDescription, @NotNull Collection<String> permissions, @NotNull String label, @Nullable Emoji emoji, @Nullable String link, @NotNull ButtonStyle style) Creates an instance of aButtonDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<ButtonDefinition> build
(MethodBuildContext context) Constructs a newButtonDefinition
from the givenMethodBuildContext
.@NotNull ClassDescription
Returns the value of theclazzDescription
record component.@NotNull String
The human-readable name of this definition.@Nullable Emoji
emoji()
Returns the value of theemoji
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull String
label()
Returns the value of thelabel
record component.@Nullable String
link()
Returns the value of thelink
record component.@NotNull MethodDescription
Returns the value of themethodDescription
record component.@NotNull Collection
<String> Returns the value of thepermissions
record component.@NotNull ButtonStyle
style()
Returns the value of thestyle
record component.@NotNull Button
Transforms this definition to anButton
with an independent custom id.@NotNull Button
toJDAEntity
(@NotNull CustomId customId) 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
-
ButtonDefinition
public ButtonDefinition(@NotNull @NotNull ClassDescription clazzDescription, @NotNull @NotNull MethodDescription methodDescription, @NotNull @NotNull Collection<String> permissions, @NotNull @NotNull String label, @Nullable @Nullable Emoji emoji, @Nullable @Nullable String link, @NotNull @NotNull ButtonStyle style) Creates an instance of aButtonDefinition
record class.- Parameters:
clazzDescription
- the value for theclazzDescription
record componentmethodDescription
- the value for themethodDescription
record componentpermissions
- the value for thepermissions
record componentlabel
- the value for thelabel
record componentemoji
- the value for theemoji
record componentlink
- the value for thelink
record componentstyle
- the value for thestyle
record component
-
-
Method Details
-
build
Constructs a newButtonDefinition
from the givenMethodBuildContext
.- Returns:
- an
ButtonDefinition
holding theStringSelectMenuDefinition
-
toJDAEntity
-
toJDAEntity
- Specified by:
toJDAEntity
in interfaceCustomIdJDAEntity<Button>
- Parameters:
customId
- theCustomId
to use- Returns:
- the
Button
-
displayName
Description copied from interface:Definition
The human-readable name of this definition.- Specified by:
displayName
in 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)
. -
clazzDescription
Returns the value of theclazzDescription
record component.- Specified by:
clazzDescription
in interfaceComponentDefinition<Button>
- 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 interfaceComponentDefinition<Button>
- Specified by:
methodDescription
in interfacecom.github.kaktushose.jda.commands.definitions.features.internal.Invokable
- Returns:
- the value of the
methodDescription
record component
-
permissions
Returns the value of thepermissions
record component.- Specified by:
permissions
in interfaceInteractionDefinition
- Returns:
- the value of the
permissions
record component
-
label
-
emoji
-
link
-
style
-