Package com.martiansoftware.nailgun
Class Alias
java.lang.Object
com.martiansoftware.nailgun.Alias
- All Implemented Interfaces:
Comparable
Provides a means to map memorable, short names to classes in order
to make the issuing of commands more convenient. For example, an
Alias can map the "
mycommand" command to the com.yourdomain.yourpackage.YourClass
class. Obviously, it's a lot easier to type "ng mycommand" than the fully
qualified class name.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares Alias names - no other fields are compared.booleanChecks whether two Aliases have the same name.Returns theClassobject providing a staticmain()ornailMain()method for this command.Returns a description for the aliased commandgetName()Returns the name of the aliased commandinthashCode()
-
Field Details
-
name
The alias name -
description
The alias description (may be used to provide help to users) -
clazz
The class providing amain()ornailMain()method
-
-
Constructor Details
-
Alias
Creates a new Alias with the specified properties.- Parameters:
name- the alias name (short command)description- a description of the commandclazz- the class implementing the command
-
-
Method Details
-
getAliasedClass
Returns theClassobject providing a staticmain()ornailMain()method for this command.- Returns:
- the
Classobject providing a staticmain()ornailMain()method for this command.
-
getName
Returns the name of the aliased command- Returns:
- the name of the aliased command
-
getDescription
Returns a description for the aliased command- Returns:
- a description for the aliased command
-
hashCode
public int hashCode() -
equals
Checks whether two Aliases have the same name. Does not compare any other fields. -
compareTo
Compares Alias names - no other fields are compared.- Specified by:
compareToin interfaceComparable- See Also:
-