Record Class StringSelectMenuDefinition.SelectOptionDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.component.menu.StringSelectMenuDefinition.SelectOptionDefinition
- Record Components:
value
- the value of the select optionlabel
- the label of the select optiondescription
- the description of the select optionemoji
- theEmoji
of the select option ornull
isDefault
- whether the select option is a default value
- All Implemented Interfaces:
Definition
,JDAEntity<SelectOption>
- Enclosing class:
StringSelectMenuDefinition
public static record StringSelectMenuDefinition.SelectOptionDefinition(@NotNull String value, @NotNull 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
SelectOption
.-
Constructor Summary
ConstructorDescriptionSelectOptionDefinition
(@NotNull String value, @NotNull String label, @Nullable String description, @Nullable Emoji emoji, boolean isDefault) Creates an instance of aSelectOptionDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionbuild
(SelectOption option) Constructs a newStringSelectMenuDefinition.SelectOptionDefinition
from the givenSelectOption
.@Nullable String
Returns the value of thedescription
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.boolean
Returns the value of theisDefault
record component.@NotNull String
label()
Returns the value of thelabel
record component.@NotNull SelectOption
Transforms this definition into aSelectOption
.final String
toString()
Returns a string representation of this record class.@NotNull String
value()
Returns the value of thevalue
record component.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.Definition
definitionId
-
Constructor Details
-
SelectOptionDefinition
public SelectOptionDefinition(@NotNull @NotNull String value, @NotNull @NotNull String label, @Nullable @Nullable String description, @Nullable @Nullable Emoji emoji, boolean isDefault) Creates an instance of aSelectOptionDefinition
record class.- Parameters:
value
- the value for thevalue
record componentlabel
- the value for thelabel
record componentdescription
- the value for thedescription
record componentemoji
- the value for theemoji
record componentisDefault
- the value for theisDefault
record component
-
-
Method Details
-
build
Constructs a newStringSelectMenuDefinition.SelectOptionDefinition
from the givenSelectOption
. -
displayName
Description copied from interface:Definition
The human-readable name of this definition.- Specified by:
displayName
in interfaceDefinition
-
toJDAEntity
Transforms this definition into aSelectOption
.- Specified by:
toJDAEntity
in interfaceJDAEntity<SelectOption>
- Returns:
- a JDA entity of type
JDAEntity
-
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 thecompare
method from their corresponding wrapper classes. -
value
-
label
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
emoji
-
isDefault
-