Package discord4j.core.object.command
Class ApplicationCommandOptionChoice
- java.lang.Object
-
- discord4j.core.object.command.ApplicationCommandOptionChoice
-
- All Implemented Interfaces:
DiscordObject
@Experimental public class ApplicationCommandOptionChoice extends Object implements DiscordObject
A Discord application command option choice.- See Also:
- Application Command Option Choice Object
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_NAME_LENGTHThe maximum amount of characters that can be in an application command option choice name.static intMAX_VALUE_LENGTHThe maximum amount of characters that can be in an application command option choice value.
-
Constructor Summary
Constructors Constructor Description ApplicationCommandOptionChoice(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationCommandOptionChoiceData data)Constructs anApplicationCommandOptionChoicewith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleasDouble()Gets the value of this choice as a double.longasLong()Gets the value of this choice as a long.StringasString()Gets the value of this choice as a string.GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.StringgetName()Gets the name of this choice.ObjectgetValue()Gets the value of this choice.
-
-
-
Field Detail
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTH
The maximum amount of characters that can be in an application command option choice name.- See Also:
- Constant Field Values
-
MAX_VALUE_LENGTH
public static final int MAX_VALUE_LENGTH
The maximum amount of characters that can be in an application command option choice value.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApplicationCommandOptionChoice
public ApplicationCommandOptionChoice(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationCommandOptionChoiceData data)
Constructs anApplicationCommandOptionChoicewith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated to this object, must be non-null.data- The raw data as represented by Discord, must be non-null.
-
-
Method Detail
-
getName
public String getName()
Gets the name of this choice.- Returns:
- The name of this choice.
-
getValue
public Object getValue()
Gets the value of this choice.- Returns:
- The value of this choice.
-
asString
public String asString()
Gets the value of this choice as a string.- Returns:
- The value of this choice as a string.
-
asLong
public long asLong()
Gets the value of this choice as a long.- Returns:
- The value of this choice as a long.
-
asDouble
public double asDouble()
Gets the value of this choice as a double.- Returns:
- The value of this choice as a double.
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
-