Interface CommandArgument<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()
      Gets this argument's description for use in help commands.
      @NotNull java.lang.String getName()
      Gets this argument's name.
      T getValue​(java.util.Queue<java.lang.String> args, CommandContext<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> context)
      Reads from a queue to get the value for this argument.
      boolean isOptional()
      Gets whether this argument is optional or not.
      @Nullable java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.String> args, CommandContext<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> context)
      Tab-completes this node.
    • Method Detail

      • getName

        @NotNull
        @NotNull java.lang.String getName()
        Gets this argument's name.
        Returns:
        the name
      • getDescription

        java.lang.String getDescription()
        Gets this argument's description for use in help commands. This should be a simple, one-line sentence.
        Returns:
        the description
      • getValue

        T getValue​(java.util.Queue<java.lang.String> args,
                   CommandContext<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> context)
        Reads from a queue to get the value for this argument.
        Parameters:
        args - a queue of strings containing the raw arguments. Pop as many as needed and no more.
        context - the context that this command has been executed in. Be aware that arguments may not yet be populated.
        Returns:
        the parsed string value of this argument.
      • tabComplete

        @Nullable
        @Nullable java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.String> args,
                                                               CommandContext<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> context)
        Tab-completes this node.
        Parameters:
        args - a queue of strings containing the raw arguments. Pop as many as needed and no more.
        context - the context that this command has been executed in. Be aware that arguments may not yet be populated.
        Returns:
        the tabcompleted value of this node, or if not applicable, null
      • isOptional

        boolean isOptional()
        Gets whether this argument is optional or not. This should not change how the argument behaves.