Package me.s3ns3iw00.jcommands.argument
Class Argument<O>
- java.lang.Object
-
- me.s3ns3iw00.jcommands.argument.Argument<O>
-
- Type Parameters:
O
- the type of output
- Direct Known Subclasses:
InputArgument
,SubArgument
public abstract class Argument<O> extends java.lang.Object
Represents an argument
-
-
Constructor Summary
Constructors Constructor Description Argument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type)
Default constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract org.javacord.api.interaction.SlashCommandOption
getCommandOption()
java.lang.String
getDescription()
java.util.Optional<ArgumentMismatchEventListener>
getMismatchListener()
Deprecated.java.lang.String
getName()
abstract java.lang.Class<O>
getResultType()
org.javacord.api.interaction.SlashCommandOptionType
getType()
void
setOnMismatch(ArgumentMismatchEventListener listener)
Deprecated.
-
-
-
Constructor Detail
-
Argument
public Argument(java.lang.String name, java.lang.String description, org.javacord.api.interaction.SlashCommandOptionType type)
Default constructor- Parameters:
name
- the name of the command Its length must between 1 and 32 Can contain only: - word characters - numbers - '-' charactersdescription
- the description of the command Its length must between 1 and 100type
- the type of the argument
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- the argument's name
-
getDescription
public java.lang.String getDescription()
- Returns:
- the argument's description
-
getType
public org.javacord.api.interaction.SlashCommandOptionType getType()
- Returns:
- type of the argument
-
getResultType
public abstract java.lang.Class<O> getResultType()
- Returns:
- the class of the result's type
-
getCommandOption
public abstract org.javacord.api.interaction.SlashCommandOption getCommandOption()
- Returns:
- the command option that need for to register the argument
-
setOnMismatch
@Deprecated public void setOnMismatch(ArgumentMismatchEventListener listener)
Deprecated.Sets the argument mismatch listener- Parameters:
listener
- the listener
-
getMismatchListener
@Deprecated public java.util.Optional<ArgumentMismatchEventListener> getMismatchListener()
Deprecated.Gets the argument mismatch listener- Returns:
Optional.empty()
when argument mismatch listener is not specified, otherwiseOptional.of(Object)
with the listener
-
-