Class AbstractArgument<T>

java.lang.Object
net.lucypoulton.squirtgun.command.argument.AbstractArgument<T>
All Implemented Interfaces:
CommandArgument<T>
Direct Known Subclasses:
GreedyStringArgument, ListArgument, OnlinePlayerArgument, SingleWordArgument, SubcommandNodeArgument

public abstract class AbstractArgument<T> extends Object implements CommandArgument<T>
An abstract argument, encapsulating the name and description fields.
  • Constructor Details

    • AbstractArgument

      protected AbstractArgument(String name, String description, boolean isOptional)
      Parameters:
      name - the argument's name
      description - the argument's description
  • Method Details

    • getName

      @NotNull public final @NotNull String getName()
      Description copied from interface: CommandArgument
      Gets this argument's name.
      Specified by:
      getName in interface CommandArgument<T>
      Returns:
      the name
    • getDescription

      public final String getDescription()
      Description copied from interface: CommandArgument
      Gets this argument's description for use in help commands. This should be a simple, one-line sentence.
      Specified by:
      getDescription in interface CommandArgument<T>
      Returns:
      the description
    • isOptional

      public boolean isOptional()
      Description copied from interface: CommandArgument
      Gets whether this argument is optional or not. This should not change how the argument behaves.
      Specified by:
      isOptional in interface CommandArgument<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object