Package me.s3ns3iw00.jcommands.argument
Class InputArgument<I,O>
- java.lang.Object
-
- me.s3ns3iw00.jcommands.argument.Argument<O>
-
- me.s3ns3iw00.jcommands.argument.InputArgument<I,O>
-
- Type Parameters:
I- the type of inputO- the type of output
- Direct Known Subclasses:
AttachmentArgument,AutocompletableInputArgument,ChannelArgument,ComboArgument,MentionArgument,RoleArgument,URLArgument
public abstract class InputArgument<I,O> extends Argument<O>
Represents argument that can have multiple value depends on the user input and the restrictions of the argument These arguments can be optional
-
-
Constructor Summary
Constructors Constructor Description InputArgument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type)Constructs the argument with the default requirementsInputArgument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type, java.lang.Class<O> resultType)Runs the default constructor and specifies the result type of the value, that the input will be converted to
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvertResult(ArgumentResultConverter<I,O> resultConverter)ArgumentValidator<I>getArgumentValidator()org.javacord.api.interaction.SlashCommandOptiongetCommandOption()java.util.Optional<ArgumentResultConverter<I,O>>getResultConverter()java.lang.Class<O>getResultType()booleanisOptional()voidsetOptional()-
Methods inherited from class me.s3ns3iw00.jcommands.argument.Argument
getDescription, getMismatchListener, getName, getType, setOnMismatch
-
-
-
-
Constructor Detail
-
InputArgument
public InputArgument(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
-
InputArgument
public InputArgument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type, java.lang.Class<O> resultType)Runs the default constructor and specifies the result type of the value, that the input will be converted to- Parameters:
name- the argument's namedescription- the argument's descriptiontype- the type of the valueresultType- the type of the converted value
-
-
Method Detail
-
getCommandOption
public org.javacord.api.interaction.SlashCommandOption getCommandOption()
- Specified by:
getCommandOptionin classArgument<O>- Returns:
- the command option that need for to register the argument
-
isOptional
public boolean isOptional()
-
setOptional
public void setOptional()
-
getResultType
public java.lang.Class<O> getResultType()
- Specified by:
getResultTypein classArgument<O>- Returns:
- the class of the result's type
-
getArgumentValidator
public ArgumentValidator<I> getArgumentValidator()
-
convertResult
public void convertResult(ArgumentResultConverter<I,O> resultConverter)
-
getResultConverter
public java.util.Optional<ArgumentResultConverter<I,O>> getResultConverter()
-
-