Class ComboArgument
- java.lang.Object
-
- me.s3ns3iw00.jcommands.argument.Argument<O>
-
- me.s3ns3iw00.jcommands.argument.InputArgument<java.lang.Object,Choice>
-
- me.s3ns3iw00.jcommands.argument.type.ComboArgument
-
public class ComboArgument extends InputArgument<java.lang.Object,Choice>
Represents anInputArgument
that has multiple choices, and they are the only valid values for the user to pick The values are key value pairs The key isString
and the value can beString
orLong
-
-
Constructor Summary
Constructors Constructor Description ComboArgument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type)
Constructs the argument with the default requirements
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChoice(java.lang.String key, long value)
Adds a choicevoid
addChoice(java.lang.String key, java.lang.String value)
Adds a choiceChoice
getChoice(java.lang.Object value)
Returns the choice based on valueorg.javacord.api.interaction.SlashCommandOption
getCommandOption()
java.lang.Class<Choice>
getResultType()
-
Methods inherited from class me.s3ns3iw00.jcommands.argument.InputArgument
convertResult, getArgumentValidator, getResultConverter, isOptional, setOptional
-
Methods inherited from class me.s3ns3iw00.jcommands.argument.Argument
getDescription, getMismatchListener, getName, getType, setOnMismatch
-
-
-
-
Constructor Detail
-
ComboArgument
public ComboArgument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type)
Constructs the argument with the default requirements- Parameters:
name
- the argument's namedescription
- the argument's descriptiontype
- the type of the input value, can beSlashCommandOptionType.STRING
orSlashCommandOptionType.LONG
-
-
Method Detail
-
addChoice
public void addChoice(java.lang.String key, java.lang.String value)
Adds a choice- Parameters:
key
- is the name of the argumentvalue
- is the value of the argument asString
-
addChoice
public void addChoice(java.lang.String key, long value)
Adds a choice- Parameters:
key
- the name of the argumentvalue
- the value of the argument asLong
-
getChoice
public Choice getChoice(java.lang.Object value)
Returns the choice based on value- Parameters:
value
- the value
-
getResultType
public java.lang.Class<Choice> getResultType()
- Overrides:
getResultType
in classInputArgument<java.lang.Object,Choice>
- Returns:
- the class of the result's type
-
getCommandOption
public org.javacord.api.interaction.SlashCommandOption getCommandOption()
- Overrides:
getCommandOption
in classInputArgument<java.lang.Object,Choice>
- Returns:
- the command option that need for to register the argument
-
-