org.springframework.core.enums
Class StringCodedLabeledEnum
java.lang.Object
org.springframework.core.enums.AbstractLabeledEnum
org.springframework.core.enums.StringCodedLabeledEnum
- All Implemented Interfaces:
- Serializable, Comparable, LabeledEnum
public class StringCodedLabeledEnum
- extends AbstractLabeledEnum
Implementation of LabeledEnum which uses a String as the code type.
Should almsot 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
- See Also:
LabeledEnumResolver.getLabeledEnumSet(Class)
,
Serialized Form
Method Summary |
Comparable |
getCode()
This abstract method declaration shadows the method in the LabeledEnum interface. |
String |
getStringCode()
Return the String code of this LabeledEnum instance. |
StringCodedLabeledEnum
public StringCodedLabeledEnum(String code,
String label)
- Create a new StringCodedLabeledEnum instance.
- Parameters:
code
- the String codelabel
- the label (can be null)
getCode
public Comparable getCode()
- Description copied from class:
AbstractLabeledEnum
- This abstract method declaration shadows the method in the LabeledEnum interface.
This is necessary to properly work on Sun's JDK 1.3 classic VM in all cases.
- Specified by:
getCode
in interface LabeledEnum
- Specified by:
getCode
in class AbstractLabeledEnum
getStringCode
public String getStringCode()
- Return the String code of this LabeledEnum instance.
Copyright (c) 2002-2005 The Spring Framework Project.