Package discord4j.core.object.component
Class SelectMenu.Option
java.lang.Object
discord4j.core.object.component.SelectMenu.Option
- Enclosing class:
- SelectMenu
An option displayed in a select menu.
-
Method Summary
Modifier and TypeMethodDescriptionGets the option's description.getEmoji()
Gets the option's emoji.getLabel()
Gets the option's label.getValue()
Gets the option's value.boolean
Gets whether the option is default.static SelectMenu.Option
Creates a select menu option.static SelectMenu.Option
Creates a default select menu option.withDefault
(boolean isDefault) Creates a new possibly-default option with the same data as this one.withDescription
(String description) Creates a new option with the same data as this one, but with the given description.withEmoji
(ReactionEmoji emoji) Creates a new option with the same data as this one, but with the given emoji.
-
Method Details
-
of
Creates a select menu option.- Parameters:
label
- The user-facing name of the optionvalue
- A developer-defined identifier for the option.- Returns:
- A select menu option with the given data.
-
ofDefault
Creates a default select menu option.Default options are selected by default.
- Parameters:
label
- The user-facing name of the optionvalue
- A developer-defined identifier for the option.- Returns:
- A default select menu option with the given data.
-
getLabel
Gets the option's label.- Returns:
- The option's label.
-
getValue
Gets the option's value.- Returns:
- The option's value.
-
getDescription
Gets the option's description.- Returns:
- The option's description.
-
getEmoji
Gets the option's emoji.- Returns:
- The option's emoji.
-
isDefault
public boolean isDefault()Gets whether the option is default.- Returns:
- Whether the option is default.
-
withDescription
Creates a new option with the same data as this one, but with the given description.- Parameters:
description
- The additional description of the option.- Returns:
- A new option with the given description.
-
withEmoji
Creates a new option with the same data as this one, but with the given emoji.- Parameters:
emoji
- An emoji to display with the option.- Returns:
- A new option with the given emoji.
-
withDefault
Creates a new possibly-default option with the same data as this one.- Parameters:
isDefault
- Whether the option should be default.- Returns:
- A new option with the given default state.
-