org.springframework.core.enums
Class StringCodedLabeledEnum
java.lang.Object
org.springframework.core.enums.AbstractLabeledEnum
org.springframework.core.enums.AbstractGenericLabeledEnum
org.springframework.core.enums.StringCodedLabeledEnum
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable, LabeledEnum
Deprecated. as of Spring 3.0, in favor of Java 5 enums.
@Deprecated
public class StringCodedLabeledEnum
- extends AbstractGenericLabeledEnum
Implementation of LabeledEnum which uses a String as the code type.
Should almost always be subclassed, but for some simple situations it may be
used directly. Note that you will not be able to use unique type-based
functionality like LabeledEnumResolver.getLabeledEnumSet(type) in this case.
- Since:
- 1.2.2
- Author:
- Keith Donald, Juergen Hoeller
- See Also:
LabeledEnumResolver.getLabeledEnumSet(Class)
,
Serialized Form
Field Summary |
private java.lang.String |
code
Deprecated. The unique code of this enum. |
Constructor Summary |
StringCodedLabeledEnum(java.lang.String code,
java.lang.String label)
Deprecated. Create a new StringCodedLabeledEnum instance. |
Method Summary |
java.lang.Comparable |
getCode()
Deprecated. Return this enumeration's code. |
java.lang.String |
getStringCode()
Deprecated. Return the String code of this LabeledEnum instance. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
code
private final java.lang.String code
- Deprecated.
- The unique code of this enum.
StringCodedLabeledEnum
public StringCodedLabeledEnum(java.lang.String code,
java.lang.String label)
- Deprecated.
- Create a new StringCodedLabeledEnum instance.
- Parameters:
code
- the String codelabel
- the label (can be null
)
getCode
public java.lang.Comparable getCode()
- Deprecated.
- Description copied from interface:
LabeledEnum
- Return this enumeration's code.
Each code should be unique within enumerations of the same type.
getStringCode
public java.lang.String getStringCode()
- Deprecated.
- Return the String code of this LabeledEnum instance.