org.springframework.core.enums
Class LetterCodedLabeledEnum
java.lang.Object
org.springframework.core.enums.AbstractLabeledEnum
org.springframework.core.enums.AbstractGenericLabeledEnum
org.springframework.core.enums.LetterCodedLabeledEnum
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable, LabeledEnum
public class LetterCodedLabeledEnum
- extends AbstractGenericLabeledEnum
Implementation of LabeledEnum which uses a letter 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:
- Serialized Form
Constructor Summary |
LetterCodedLabeledEnum(char code,
java.lang.String label)
Create a new LetterCodedLabeledEnum instance. |
Method Summary |
java.lang.Comparable |
getCode()
Return this enumeration's code. |
char |
getLetterCode()
Return the letter code of this LabeledEnum instance. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
LetterCodedLabeledEnum
public LetterCodedLabeledEnum(char code,
java.lang.String label)
- Create a new LetterCodedLabeledEnum instance.
- Parameters:
code
- the letter codelabel
- the label (can be null
)
getCode
public java.lang.Comparable getCode()
- Description copied from interface:
LabeledEnum
- Return this enumeration's code.
Each code should be unique within enumerations of the same type.
getLetterCode
public char getLetterCode()
- Return the letter code of this LabeledEnum instance.
Copyright © 2002-2008 The Spring Framework.