|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.communications.command.CommandType
public class CommandType
Encapsulates the identification of a command type. This class is immutable.
| Constructor Summary | |
|---|---|
CommandType(CommandType original)
Copy constructor for CommandType. |
|
CommandType(String nameVersion)
Constructor for CommandType given a string string that encodes both the command type name and version. |
|
CommandType(String name,
int version)
Constructor for CommandType. |
|
| Method Summary | |
|---|---|
int |
compareTo(Object obj)
Used strictly to determine if one command type has a higher or lower version number than another with the same command type name. |
boolean |
equals(Object obj)
CommandType objects are equal if they have the same name and same
version. |
String |
getName()
Returns the name of this command type. |
int |
getVersion()
Returns the version number associated with this command type. |
int |
hashCode()
|
String |
toString()
This will return the name of the command following by the version (prefixed with a 'v') unless the version number is 1, in which case just the name is returned. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CommandType(String name,
int version)
throws IllegalArgumentException
CommandType.
name - the name of the command typeversion - the version of the command type
IllegalArgumentException - if name is null or emptypublic CommandType(CommandType original)
CommandType.
original - the original object to copy
public CommandType(String nameVersion)
throws IllegalArgumentException
CommandType given a string string that encodes both the command type name and version.
The string must separate the name and version with a space. The version may simply be a number or (as with the
format returned by toString()) may be prefixed with 'v'. Examples: "cmd 5", "cmd v5". If just the name
was specified with no version, the version will default to 1.
nameVersion - command type name and version separated with a space
IllegalArgumentException - if name is null or nameVersion was
invalid| Method Detail |
|---|
public String getName()
public int getVersion()
public String toString()
toString in class ObjectObject.toString()public boolean equals(Object obj)
name and same
version.
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()
public int compareTo(Object obj)
throws IllegalArgumentException
command type name. If the given object's command type name does not equal this object's
command type name, an IllegalArgumentException is thrown - you cannot compare two command types with
different names.
compareTo in interface ComparableIllegalArgumentExceptionComparable.compareTo(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||