Record Class StringSelectMenuDefinition.MenuOptionDefinition
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.component.menu.StringSelectMenuDefinition.MenuOptionDefinition
- Record Components:
value- the value of the select optionlabel- the label of the select optiondescription- the description of the select optionemoji- theEmojiof the select option ornullisDefault- whether the select option is a default value
- All Implemented Interfaces:
Definition, JDAEntity<SelectOption>
- Enclosing class:
StringSelectMenuDefinition
public static record StringSelectMenuDefinition.MenuOptionDefinition(String value, String label, @Nullable String description, @Nullable Emoji emoji, boolean isDefault)
extends Record
implements JDAEntity<SelectOption>, Definition
Representation of a select option for a string select menu defined by a
MenuOption.-
Constructor Summary
ConstructorsConstructorDescriptionMenuOptionDefinition(String value, String label, @Nullable String description, @Nullable Emoji emoji, boolean isDefault) Creates an instance of aMenuOptionDefinitionrecord class.MenuOptionDefinition(SelectOption option) -
Method Summary
Modifier and TypeMethodDescriptionbuild(MenuOption option) Constructs a newStringSelectMenuDefinition.MenuOptionDefinitionfrom the givenMenuOption.@Nullable StringReturns the value of thedescriptionrecord component.The human-readable name of this definition.@Nullable 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.booleanReturns the value of theisDefaultrecord component.label()Returns the value of thelabelrecord component.Transforms this definition into aSelectOption.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.Methods inherited from interface Definition
definitionId
-
Constructor Details
-
MenuOptionDefinition
-
MenuOptionDefinition
public MenuOptionDefinition(String value, String label, @Nullable String description, @Nullable Emoji emoji, boolean isDefault) Creates an instance of aMenuOptionDefinitionrecord class.- Parameters:
value- the value for thevaluerecord componentlabel- the value for thelabelrecord componentdescription- the value for thedescriptionrecord componentemoji- the value for theemojirecord componentisDefault- the value for theisDefaultrecord component
-
-
Method Details
-
build
Constructs a newStringSelectMenuDefinition.MenuOptionDefinitionfrom the givenMenuOption. -
displayName
Description copied from interface:DefinitionThe human-readable name of this definition.- Specified by:
displayNamein interfaceDefinition
-
toJDAEntity
Transforms this definition into aSelectOption.- Specified by:
toJDAEntityin interfaceJDAEntity<SelectOption>- Returns:
- a JDA entity of type
T
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
value
-
label
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
emoji
-
isDefault
-