Package org.aesh.readline.alias
Class Alias
java.lang.Object
org.aesh.readline.alias.Alias
- All Implemented Interfaces:
Comparable
Alias value object
- Author:
- Ståle W. Pedersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares this alias to another alias by name for ordering.booleanCompares this alias to another object for equality.getName()Returns the name of this alias.getValue()Returns the value of this alias.inthashCode()Returns a hash code value for this alias.toString()Returns a string representation of this alias in the format "name='value'".
-
Constructor Details
-
Alias
Creates a new Alias with the specified name and value.- Parameters:
name- the alias name used to invoke the aliasvalue- the command or text that the alias expands to
-
-
Method Details
-
getName
Returns the name of this alias.- Returns:
- the alias name
-
getValue
Returns the value of this alias.- Returns:
- the command or text that the alias expands to
-
equals
Compares this alias to another object for equality. Two aliases are considered equal if they have the same name. -
hashCode
public int hashCode()Returns a hash code value for this alias. -
toString
Returns a string representation of this alias in the format "name='value'". -
compareTo
Compares this alias to another alias by name for ordering.- Specified by:
compareToin interfaceComparable- Parameters:
o- the alias to compare with- Returns:
- a negative integer, zero, or a positive integer as this alias name is less than, equal to, or greater than the specified alias name
-