当前页面:
在线文档首页 >
Spring Framework 2.0.5 API 文档英文版
StringCodedLabeledEnum (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版
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:
- Serializable, Comparable, LabeledEnum
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
- See Also:
LabeledEnumResolver.getLabeledEnumSet(Class)
,
Serialized Form
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 interface:
LabeledEnum
- Return this enumeration's code.
Each code should be unique within enumeration's of the same type.
- 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 © 2002-2007 The Spring Framework.