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.YourClassclass. 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 intcompareTo(Object o)Compares Alias names - no other fields are compared.booleanequals(Object o)Checks whether two Aliases have the same name.ClassgetAliasedClass()Returns theClassobject providing a staticmain()ornailMain()method for this command.StringgetDescription()Returns a description for the aliased commandStringgetName()Returns the name of the aliased commandinthashCode()
-
-
-
Method Detail
-
getAliasedClass
public Class getAliasedClass()
Returns theClassobject providing a staticmain()ornailMain()method for this command.- Returns:
- the
Classobject 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:
hashCodein 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:
compareToin interfaceComparable- See Also:
Comparable.compareTo(Object)
-
-