Interface AbstractCommand<T>
-
- All Superinterfaces:
java.lang.Comparable<AbstractCommand<T>>
public interface AbstractCommand<T> extends java.lang.Comparable<AbstractCommand<T>>
This represents a generic command.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcompareTo(AbstractCommand<T> that)voidexecute(T message, java.lang.String args)Execute this command.default java.lang.StringgetAttribute(java.lang.String key)Returns theStringthat the givenCommandAttributecontains.default CommandAttribute[]getAttributes()Return theCommandAttributes that are contained within theCommandDescriptionannotatordefault CommandDescriptiongetDescription()Get theCommandDescriptionthat annotates thisAbstractCommanddefault booleanhasAttribute(java.lang.String key)Returns if theCommandDescriptioncontains aCommandAttributewith the given key.
-
-
-
Method Detail
-
execute
void execute(T message, java.lang.String args)
Execute this command.- Parameters:
message- T is the object that is passed to this commandargs- The arguments from the command- Since:
- 1.1.3
-
getDescription
default CommandDescription getDescription()
Get theCommandDescriptionthat annotates thisAbstractCommand- Returns:
- The
CommandDescription - Since:
- 1.1.3
-
getAttributes
default CommandAttribute[] getAttributes()
Return theCommandAttributes that are contained within theCommandDescriptionannotator- Returns:
- The
CommandAttributes - Since:
- 1.1.3
-
hasAttribute
default boolean hasAttribute(java.lang.String key)
Returns if theCommandDescriptioncontains aCommandAttributewith the given key.- Parameters:
key- The key to check theCommandAttributeagainst.- Returns:
- If the relevant
CommandAttributeexists - Since:
- 1.1.3
-
getAttribute
default java.lang.String getAttribute(java.lang.String key)
Returns theStringthat the givenCommandAttributecontains.- Parameters:
key- The key to get theCommandAttributeof.- Returns:
- The relevant
String - Since:
- 1.1.3
-
compareTo
default int compareTo(AbstractCommand<T> that)
- Specified by:
compareToin interfacejava.lang.Comparable<T>
-
-