org.xins.common.types
Class EnumItem

java.lang.Object
  extended byorg.xins.common.types.EnumItem

public class EnumItem
extends Object

Item in an enumeration type.

Since:
XINS 1.0.0
Version:
$Revision: 1.16 $ $Date: 2006/08/28 09:12:34 $
Author:
Ernst de Haan
See Also:
EnumType

Constructor Summary
EnumItem(String name, String value)
          Creates a new EnumItem.
 
Method Summary
 boolean equals(Object obj)
          Checks if this object is considered equal to the specified object.
 String getName()
          Gets the symbolic (friendly) name for the enumeration value.
 String getValue()
          Gets the value for this enumeration item.
 int hashCode()
          Returns the hash code for this object.
 String toString()
          Returns a textual representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumItem

public EnumItem(String name,
                String value)
         throws IllegalArgumentException
Creates a new EnumItem.

Parameters:
name - the symbolic (friendly) name for the enumeration value, not null.
value - the actual value of the enumeration item, not null.
Throws:
IllegalArgumentException - if name == null || value == null.
Method Detail

getName

public final String getName()
Gets the symbolic (friendly) name for the enumeration value.

Returns:
the symbolic name, not null.

getValue

public String getValue()
Gets the value for this enumeration item.

Returns:
the actual value of this enumeration item, not null.

hashCode

public int hashCode()
Returns the hash code for this object.

Returns:
the hash code.

equals

public boolean equals(Object obj)
Checks if this object is considered equal to the specified object. In order for it to qualify as equals, it needs to be an instance of the very same class as this object (not even a subclass), and it needs to have the same name and value.

Parameters:
obj - the object to compare, or null.
Returns:
true if obj is considered equal to this instance, or false otherwise.

toString

public String toString()
Returns a textual representation of this object.

Returns:
a textual representation of this object, never null.


See http://www.xins.org/.