@Deprecated public abstract class AbstractCachingLabeledEnumResolver extends Object implements LabeledEnumResolver
LabeledEnumResolver
implementations,
caching all retrieved LabeledEnum
instances.
Subclasses need to implement the template method
findLabeledEnums(Class)
.
findLabeledEnums(Class)
Constructor and Description |
---|
AbstractCachingLabeledEnumResolver()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Set<LabeledEnum> |
findLabeledEnums(Class type)
Deprecated.
Template method to be implemented by subclasses.
|
LabeledEnum |
getLabeledEnumByCode(Class type,
Comparable code)
Deprecated.
Resolve a single
LabeledEnum by its identifying code. |
LabeledEnum |
getLabeledEnumByLabel(Class type,
String label)
Deprecated.
Resolve a single
LabeledEnum by its identifying code. |
Map<Comparable,LabeledEnum> |
getLabeledEnumMap(Class type)
Deprecated.
Return a map of enumerations of a particular type.
|
Set<LabeledEnum> |
getLabeledEnumSet(Class type)
Deprecated.
Return a set of enumerations of a particular type.
|
protected final transient Log logger
public AbstractCachingLabeledEnumResolver()
public Set<LabeledEnum> getLabeledEnumSet(Class type) throws IllegalArgumentException
LabeledEnumResolver
getLabeledEnumSet
in interface LabeledEnumResolver
type
- the enum typeIllegalArgumentException
- if the type is not supportedpublic Map<Comparable,LabeledEnum> getLabeledEnumMap(Class type) throws IllegalArgumentException
LabeledEnumResolver
LabeledEnum
instance.getLabeledEnumMap
in interface LabeledEnumResolver
type
- the enum typeLabeledEnum
instance as valueIllegalArgumentException
- if the type is not supportedpublic LabeledEnum getLabeledEnumByCode(Class type, Comparable code) throws IllegalArgumentException
LabeledEnumResolver
LabeledEnum
by its identifying code.getLabeledEnumByCode
in interface LabeledEnumResolver
type
- the enum typecode
- the enum codeIllegalArgumentException
- if the code did not map to a valid instancepublic LabeledEnum getLabeledEnumByLabel(Class type, String label) throws IllegalArgumentException
LabeledEnumResolver
LabeledEnum
by its identifying code.getLabeledEnumByLabel
in interface LabeledEnumResolver
type
- the enum typelabel
- the enum labelIllegalArgumentException
- if the label did not map to a valid instanceprotected abstract Set<LabeledEnum> findLabeledEnums(Class type)
type
- the enum typeLabeledEnum