Package org.javacord.core.interaction
Class SlashCommandOptionChoiceImpl
- java.lang.Object
-
- org.javacord.core.interaction.SlashCommandOptionChoiceImpl
-
- All Implemented Interfaces:
SlashCommandOptionChoice
public class SlashCommandOptionChoiceImpl extends java.lang.Object implements SlashCommandOptionChoice
-
-
Constructor Summary
Constructors Constructor Description SlashCommandOptionChoiceImpl(com.fasterxml.jackson.databind.JsonNode data)
Class constructor.SlashCommandOptionChoiceImpl(java.lang.String name, java.util.Map<DiscordLocale,java.lang.String> nameLocalizations, java.lang.String stringValue, java.lang.Long longValue)
Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.Long>
getLongValue()
java.lang.String
getName()
java.util.Map<DiscordLocale,java.lang.String>
getNameLocalizations()
java.util.Optional<java.lang.String>
getStringValue()
com.fasterxml.jackson.databind.JsonNode
toJsonNode()
Creates a json node with the choice's data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.javacord.api.interaction.SlashCommandOptionChoice
getValueAsString
-
-
-
-
Constructor Detail
-
SlashCommandOptionChoiceImpl
public SlashCommandOptionChoiceImpl(com.fasterxml.jackson.databind.JsonNode data)
Class constructor.- Parameters:
data
- The json data of the choice.
-
SlashCommandOptionChoiceImpl
public SlashCommandOptionChoiceImpl(java.lang.String name, java.util.Map<DiscordLocale,java.lang.String> nameLocalizations, java.lang.String stringValue, java.lang.Long longValue)
Class constructor.- Parameters:
name
- The name of the choice.nameLocalizations
- The name localizations of this choice.stringValue
- The string value of the choice or null if it is an int value.longValue
- The long value of the choice or null if it is a string value.
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceSlashCommandOptionChoice
-
getNameLocalizations
public java.util.Map<DiscordLocale,java.lang.String> getNameLocalizations()
- Specified by:
getNameLocalizations
in interfaceSlashCommandOptionChoice
-
getStringValue
public java.util.Optional<java.lang.String> getStringValue()
- Specified by:
getStringValue
in interfaceSlashCommandOptionChoice
-
getLongValue
public java.util.Optional<java.lang.Long> getLongValue()
- Specified by:
getLongValue
in interfaceSlashCommandOptionChoice
-
toJsonNode
public com.fasterxml.jackson.databind.JsonNode toJsonNode()
Creates a json node with the choice's data.- Returns:
- The json node.
-
-