Class Choice
- java.lang.Object
-
- me.s3ns3iw00.jcommands.argument.util.Choice
-
public class Choice extends java.lang.Object
A helper data class that stores data for creating aSlashCommandOptionChoice
-
-
Constructor Summary
Constructors Constructor Description Choice(java.lang.String key, java.lang.Object value)
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.javacord.api.interaction.SlashCommandOptionChoice
getChoice()
Constructs theSlashCommandOptionChoice
instancejava.lang.String
getKey()
java.lang.Object
getValue()
java.lang.Long
getValueAsLong()
java.lang.String
getValueAsString()
-
-
-
Constructor Detail
-
Choice
public Choice(java.lang.String key, java.lang.Object value)
Default constructor- Parameters:
key
- the choice's key (the user will see this)value
- the choice's value can beString
orNumber
NOTE: Discord accepts onlyLong
type, thereforeNumber.longValue()
is used That means, decimals are not supported!
-
-
Method Detail
-
getKey
public java.lang.String getKey()
-
getValue
public java.lang.Object getValue()
-
getValueAsString
public java.lang.String getValueAsString()
-
getValueAsLong
public java.lang.Long getValueAsLong()
-
getChoice
public org.javacord.api.interaction.SlashCommandOptionChoice getChoice()
Constructs theSlashCommandOptionChoice
instance- Returns:
- the
SlashCommandOptionChoice
-
-