Also: SpringCore
public interface

LabeledEnumResolver

org.springframework.core.enums.LabeledEnumResolver
Known Indirect Subclasses

This interface is deprecated.
as of Spring 3.0, in favor of Java 5 enums.

Class Overview

Interface for looking up LabeledEnum instances.

Summary

Public Methods
abstract LabeledEnum getLabeledEnumByCode(Class type, Comparable code)
Resolve a single LabeledEnum by its identifying code.
abstract LabeledEnum getLabeledEnumByLabel(Class type, String label)
Resolve a single LabeledEnum by its identifying code.
abstract Map getLabeledEnumMap(Class type)
Return a map of enumerations of a particular type.
abstract Set getLabeledEnumSet(Class type)
Return a set of enumerations of a particular type.

Public Methods

public abstract LabeledEnum getLabeledEnumByCode (Class type, Comparable code)

Also: SpringCore

Resolve a single LabeledEnum by its identifying code.

Parameters
type the enum type
code the enum code
Returns
  • the enum
Throws
IllegalArgumentException if the code did not map to a valid instance

public abstract LabeledEnum getLabeledEnumByLabel (Class type, String label)

Also: SpringCore

Resolve a single LabeledEnum by its identifying code.

Parameters
type the enum type
label the enum label
Returns
  • the enum
Throws
IllegalArgumentException if the label did not map to a valid instance

public abstract Map getLabeledEnumMap (Class type)

Also: SpringCore

Return a map of enumerations of a particular type. Each element in the map should be a key/value pair, where the key is the enum code, and the value is the LabeledEnum instance.

Parameters
type the enum type
Returns
  • a Map of localized enumeration instances, with enum code as key and LabeledEnum instance as value
Throws
IllegalArgumentException if the type is not supported

public abstract Set getLabeledEnumSet (Class type)

Also: SpringCore

Return a set of enumerations of a particular type. Each element in the set should be an instance of LabeledEnum.

Parameters
type the enum type
Returns
  • a set of localized enumeration instances for the provided type
Throws
IllegalArgumentException if the type is not supported