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 TypeMethodDescriptionint
Compares Alias names - no other fields are compared.boolean
Checks whether two Aliases have the same name.Returns theClass
object providing a staticmain()
ornailMain()
method for this command.Returns a description for the aliased commandgetName()
Returns the name of the aliased commandint
hashCode()
-
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 theClass
object providing a staticmain()
ornailMain()
method for this command.- Returns:
- the
Class
object 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:
compareTo
in interfaceComparable
- See Also:
-