Interface Argument


  • public interface Argument
    Represents a command argument.
    • Method Detail

      • getIndex

        int getIndex()
        Gets the position of this argument.
        Returns:
        the position of this argument
      • get

        @NotNull
        @NotNull String get()
        Gets this argument as a string.
        Returns:
        this argument as a string
      • parseBoolean

        @Nullable
        default @Nullable Boolean parseBoolean()
        Parses the argument to Boolean.
        Returns:
        the result of parsing the arguments, or null if it fails.
        See Also:
        }
      • parseShort

        @Nullable
        default @Nullable Short parseShort()
        Parses the argument to Short.
        Returns:
        the result of parsing the arguments, or null if it fails.
        See Also:
        }
      • parseInteger

        @Nullable
        default @Nullable Integer parseInteger()
        Parses the argument to Integer.
        Returns:
        the result of parsing the arguments, or null if it fails.
        See Also:
        }
      • parseLong

        @Nullable
        default @Nullable Long parseLong()
        Parses the argument to Long.
        Returns:
        the result of parsing the arguments, or null if it fails.
        See Also:
        }
      • parseFloat

        @Nullable
        default @Nullable Float parseFloat()
        Parses the argument to Float.
        Returns:
        the result of parsing the arguments, or null if it fails.
        See Also:
        }
      • parseDouble

        @Nullable
        default @Nullable Double parseDouble()
        Parses the argument to Double.
        Returns:
        the result of parsing the arguments, or null if it fails.
        See Also:
        }
      • parse

        default <T> T parse​(ArgumentParser<T> parser)
        Parses the argument using the specified parser.
        Type Parameters:
        T - the value type
        Parameters:
        parser - the parser
        Returns:
        the result of parsing the arguments, or null if it fails.
        See Also:
        ArgumentParser.parse(Argument)