Package org.javacord.api.interaction
Enum SlashCommandOptionType
- java.lang.Object
-
- java.lang.Enum<SlashCommandOptionType>
-
- org.javacord.api.interaction.SlashCommandOptionType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SlashCommandOptionType>
public enum SlashCommandOptionType extends java.lang.Enum<SlashCommandOptionType>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ATTACHMENTBOOLEANCHANNELDECIMALAny double between -2^53 and 2^53.LONGThis is implemented as a long because it can be any integer between -2^53 and 2^53 and therefore exceeds Javas Integer range.MENTIONABLEROLESTRINGSUB_COMMANDSUB_COMMAND_GROUPUNKNOWNUSER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SlashCommandOptionTypefromValue(int value)Gets anSlashCommandOptionTypeby its value.intgetValue()Gets integer value that represents this type.static SlashCommandOptionTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SlashCommandOptionType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SUB_COMMAND
public static final SlashCommandOptionType SUB_COMMAND
-
SUB_COMMAND_GROUP
public static final SlashCommandOptionType SUB_COMMAND_GROUP
-
STRING
public static final SlashCommandOptionType STRING
-
LONG
public static final SlashCommandOptionType LONG
This is implemented as a long because it can be any integer between -2^53 and 2^53 and therefore exceeds Javas Integer range. This is the INTEGER option according to the Discord docs.
-
BOOLEAN
public static final SlashCommandOptionType BOOLEAN
-
USER
public static final SlashCommandOptionType USER
-
CHANNEL
public static final SlashCommandOptionType CHANNEL
-
ROLE
public static final SlashCommandOptionType ROLE
-
MENTIONABLE
public static final SlashCommandOptionType MENTIONABLE
-
DECIMAL
public static final SlashCommandOptionType DECIMAL
Any double between -2^53 and 2^53. This is the NUMBER option according to the Discord docs.
-
ATTACHMENT
public static final SlashCommandOptionType ATTACHMENT
-
UNKNOWN
public static final SlashCommandOptionType UNKNOWN
-
-
Method Detail
-
values
public static SlashCommandOptionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SlashCommandOptionType c : SlashCommandOptionType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SlashCommandOptionType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getValue
public int getValue()
Gets integer value that represents this type.- Returns:
- The integer value that represents this type.
-
fromValue
public static SlashCommandOptionType fromValue(int value)
Gets anSlashCommandOptionTypeby its value.- Parameters:
value- The value of the slash command option type.- Returns:
- The slash command option type for the given value,
or
UNKNOWNif there's none with the given value.
-
-