Class AbstractArgument<T>

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

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

    Constructors
    Modifier Constructor Description
    protected AbstractArgument​(java.lang.String name, java.lang.String description, boolean isOptional)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getDescription()
    Gets this argument's description for use in help commands.
    java.lang.String getName()
    Gets this argument's name.
    boolean isOptional()
    Gets whether this argument is optional or not.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface me.lucyy.squirtgun.command.argument.CommandArgument

    getValue, tabComplete
  • Constructor Details

    • AbstractArgument

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

    • getName

      public final java.lang.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 java.lang.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 java.lang.String toString()
      Overrides:
      toString in class java.lang.Object