Package com.martiansoftware.nailgun
Class Alias
- java.lang.Object
-
- com.martiansoftware.nailgun.Alias
-
- All Implemented Interfaces:
Comparable
public class Alias extends Object implements 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 thecom.yourdomain.yourpackage.YourClass
class. Obviously, it's a lot easier to type "ng mycommand
" than the fully qualified class name.- Author:
- Marty Lamb
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
Compares Alias names - no other fields are compared.boolean
equals(Object o)
Checks whether two Aliases have the same name.Class
getAliasedClass()
Returns theClass
object providing a staticmain()
ornailMain()
method for this command.String
getDescription()
Returns a description for the aliased commandString
getName()
Returns the name of the aliased commandint
hashCode()
-
-
-
Method Detail
-
getAliasedClass
public Class 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
public String getName()
Returns the name of the aliased command- Returns:
- the name of the aliased command
-
getDescription
public String getDescription()
Returns a description for the aliased command- Returns:
- a description for the aliased command
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object o)
Checks whether two Aliases have the same name. Does not compare any other fields.
-
compareTo
public int compareTo(Object o)
Compares Alias names - no other fields are compared.- Specified by:
compareTo
in interfaceComparable
- See Also:
Comparable.compareTo(Object)
-
-