Class InputArgument<I,​O>

    • 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 name
        description - the argument's description
        type - 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 name
        description - the argument's description
        type - the type of the value
        resultType - the type of the converted value
    • Method Detail

      • getCommandOption

        public org.javacord.api.interaction.SlashCommandOption getCommandOption()
        Specified by:
        getCommandOption in class Argument<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:
        getResultType in class Argument<O>
        Returns:
        the class of the result's type