Package org.javacord.api.interaction
Interface SlashCommandOptionChoice
-
public interface SlashCommandOptionChoiceA choice for a slash command option.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static SlashCommandOptionChoicecreate(java.lang.String name, long value)Create a new option choice builder to be used with a command option builder.static SlashCommandOptionChoicecreate(java.lang.String name, java.lang.String value)Create a new option choice builder to be used with a command option builder.java.util.Optional<java.lang.Long>getLongValue()Gets the long value of this choice.java.lang.StringgetName()Gets the name of this choice.java.util.Map<DiscordLocale,java.lang.String>getNameLocalizations()Gets the name localizations for this choice.java.util.Optional<java.lang.String>getStringValue()Gets the string value of this choice.default java.lang.StringgetValueAsString()Gets the value of this choice as a string.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of this choice.- Returns:
- The name of the choice.
-
getNameLocalizations
java.util.Map<DiscordLocale,java.lang.String> getNameLocalizations()
Gets the name localizations for this choice.- Returns:
- The name localizations for this choice.
-
getStringValue
java.util.Optional<java.lang.String> getStringValue()
Gets the string value of this choice.If this option is an integer choice, the optional will be empty.
- Returns:
- The string value of this choice.
-
getLongValue
java.util.Optional<java.lang.Long> getLongValue()
Gets the long value of this choice.If this option is a string choice, the optional will be empty.
- Returns:
- The long value of this choice.
-
getValueAsString
default java.lang.String getValueAsString()
Gets the value of this choice as a string.If the value is an integer, its string representation will be returned.
- Returns:
- The value of the choice as a string.
-
create
static SlashCommandOptionChoice create(java.lang.String name, java.lang.String value)
Create a new option choice builder to be used with a command option builder.- Parameters:
name- The name of the choice.value- The value of the choice.- Returns:
- The new choice builder.
-
create
static SlashCommandOptionChoice create(java.lang.String name, long value)
Create a new option choice builder to be used with a command option builder.- Parameters:
name- The name of the choice.value- The value of the choice. Can be any long between -2^53 and 2^53.- Returns:
- The new choice builder.
-
-