Record Class ButtonDefinition
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.component.ButtonDefinition
- Record Components:
classDescription- theClassDescriptionof the declaring class of themethodDescription()methodDescription- theMethodDescriptionof the method this definition is bound topermissions- aCollectionof permissions for this buttonlabel- the label of this buttonemoji- theEmojiof this button ornulllink- the link of this button ornullstyle- theButtonStyleof this buttonuniqueId- the uniqueId of this button
- All Implemented Interfaces:
Definition, CustomIdJDAEntity<net.dv8tion.jda.api.components.buttons.Button>, Invokable, JDAEntity<net.dv8tion.jda.api.components.buttons.Button>, ComponentDefinition<net.dv8tion.jda.api.components.buttons.Button>, InteractionDefinition
public record ButtonDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String label, @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji, @Nullable String link, net.dv8tion.jda.api.components.buttons.ButtonStyle style, @Nullable Integer uniqueId)
extends Record
implements ComponentDefinition<net.dv8tion.jda.api.components.buttons.Button>
Representation of a button.
-
Nested Class Summary
Nested classes/interfaces inherited from interface InteractionDefinition
InteractionDefinition.ReplyConfig -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionButtonDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String label, @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji, @Nullable String link, net.dv8tion.jda.api.components.buttons.ButtonStyle style, @Nullable Integer uniqueId) Creates an instance of aButtonDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ButtonDefinitionbuild(MethodBuildContext context) Constructs a newButtonDefinitionfrom the givenMethodBuildContext.Returns the value of theclassDescriptionrecord component.The human-readable name of this definition.@Nullable net.dv8tion.jda.api.entities.emoji.Emojiemoji()Returns the value of theemojirecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.@Nullable Stringlink()Returns the value of thelinkrecord component.Returns the value of themethodDescriptionrecord component.Returns the value of thepermissionsrecord component.net.dv8tion.jda.api.components.buttons.ButtonStylestyle()Returns the value of thestylerecord component.net.dv8tion.jda.api.components.buttons.ButtonTransforms this definition to anButtonwith an independent custom id.net.dv8tion.jda.api.components.buttons.ButtontoJDAEntity(CustomId customId) Transforms this definition to anButtonwith the givenCustomId.final StringtoString()Returns a string representation of this record class.@Nullable IntegeruniqueId()Returns the value of theuniqueIdrecord component.with(@Nullable String label, @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji, @Nullable String link, @Nullable net.dv8tion.jda.api.components.buttons.ButtonStyle style, @Nullable Integer uniqueId) Builds a newButtonDefinitionwith the given valuesMethods inherited from interface InteractionDefinition
definitionId
-
Constructor Details
-
ButtonDefinition
public ButtonDefinition(ClassDescription classDescription, MethodDescription methodDescription, Collection<String> permissions, String label, @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji, @Nullable String link, net.dv8tion.jda.api.components.buttons.ButtonStyle style, @Nullable Integer uniqueId) Creates an instance of aButtonDefinitionrecord class.- Parameters:
classDescription- the value for theclassDescriptionrecord componentmethodDescription- the value for themethodDescriptionrecord componentpermissions- the value for thepermissionsrecord componentlabel- the value for thelabelrecord componentemoji- the value for theemojirecord componentlink- the value for thelinkrecord componentstyle- the value for thestylerecord componentuniqueId- the value for theuniqueIdrecord component
-
-
Method Details
-
build
Constructs a newButtonDefinitionfrom the givenMethodBuildContext.- Returns:
- an
ButtonDefinitionholding theStringSelectMenuDefinition
-
with
public ButtonDefinition with(@Nullable String label, @Nullable net.dv8tion.jda.api.entities.emoji.Emoji emoji, @Nullable String link, @Nullable net.dv8tion.jda.api.components.buttons.ButtonStyle style, @Nullable Integer uniqueId) Builds a newButtonDefinitionwith the given values -
toJDAEntity
public net.dv8tion.jda.api.components.buttons.Button toJDAEntity()Transforms this definition to anButtonwith an independent custom id.- Specified by:
toJDAEntityin interfaceJDAEntity<net.dv8tion.jda.api.components.buttons.Button>- Returns:
- the
Button - See Also:
-
toJDAEntity
Transforms this definition to anButtonwith the givenCustomId.- Specified by:
toJDAEntityin interfaceCustomIdJDAEntity<net.dv8tion.jda.api.components.buttons.Button>- Parameters:
customId- theCustomIdto use- Returns:
- the
Button
-
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 interfaceComponentDefinition<net.dv8tion.jda.api.components.buttons.Button>- Specified by:
classDescriptionin interfaceInvokable- Returns:
- the value of the
classDescriptionrecord component
-
methodDescription
Returns the value of themethodDescriptionrecord component.- Specified by:
methodDescriptionin interfaceComponentDefinition<net.dv8tion.jda.api.components.buttons.Button>- 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
-
label
-
emoji
-
link
-
style
-
uniqueId
Returns the value of theuniqueIdrecord component.- Specified by:
uniqueIdin interfaceComponentDefinition<net.dv8tion.jda.api.components.buttons.Button>- Returns:
- the value of the
uniqueIdrecord component
-