|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.util.AbstractEnumerationValue
dsto.dfc.util.StringEnumerationValue
public abstract class StringEnumerationValue
Base class for enumerated types that have a string representation. Provides sensible defaults for toString(), hashCode() and equals(). Also provides intelligent serialization support via a readResolve () that resolves serialized enum values to their equivalent instance in getEnumValues (). Superclasses that wish to use this feature must provide a readResolve() implementation that calls super.readResolve().
Field Summary | |
---|---|
protected String |
name
|
protected String |
text
|
Constructor Summary | |
---|---|
StringEnumerationValue()
For beans compliance only. |
|
StringEnumerationValue(String name)
Create a new string enumeration value. |
|
StringEnumerationValue(String name,
String text)
Create a new string enumeration value. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
int |
findIndex(String enumName)
Find the index of an enum value with a given name. |
EnumerationValue |
findValue(String enumName)
Find the enumeration value with a given name. |
abstract EnumerationValue[] |
getEnumValues()
Get the list of values within the enumeration. |
String |
getName()
|
String |
getText()
Get the human readable text for the value. |
int |
hashCode()
|
void |
setName(String newValue)
Use only during construction. |
String |
toString()
|
Methods inherited from class dsto.dfc.util.AbstractEnumerationValue |
---|
findIndex, findIndex, readResolve |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String name
protected transient String text
Constructor Detail |
---|
public StringEnumerationValue()
public StringEnumerationValue(String name)
name
- The human readable name of the value.StringEnumerationValue(String,String)
public StringEnumerationValue(String name, String text)
name
- The logical name of the value.text
- The human readable text for the value. The text may
change without affecting the identity of the value, which is determined
by the name property.StringEnumerationValue(String,String)
Method Detail |
---|
public abstract EnumerationValue[] getEnumValues()
EnumerationValue
getEnumValues
in interface EnumerationValue
getEnumValues
in class AbstractEnumerationValue
public EnumerationValue findValue(String enumName)
enumName
- The name to find.
public int findIndex(String enumName)
enumName
- The name to find.
public String getName()
public void setName(String newValue)
public String getText()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class AbstractEnumerationValue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |