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 protectedAbstractArgument(java.lang.String name, java.lang.String description, boolean isOptional) -
Method Summary
Modifier and Type Method Description java.lang.StringgetDescription()Gets this argument's description for use in help commands.java.lang.StringgetName()Gets this argument's name.booleanisOptional()Gets whether this argument is optional or not.java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 namedescription- the argument's description
-
-
Method Details
-
getName
public final java.lang.String getName()Description copied from interface:CommandArgumentGets this argument's name.- Specified by:
getNamein interfaceCommandArgument<T>- Returns:
- the name
-
getDescription
public final java.lang.String getDescription()Description copied from interface:CommandArgumentGets this argument's description for use in help commands. This should be a simple, one-line sentence.- Specified by:
getDescriptionin interfaceCommandArgument<T>- Returns:
- the description
-
isOptional
public boolean isOptional()Description copied from interface:CommandArgumentGets whether this argument is optional or not. This should not change how the argument behaves.- Specified by:
isOptionalin interfaceCommandArgument<T>
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-