public interface

LabeledEnum

implements Serializable Comparable<T>
org.springframework.core.enums.LabeledEnum
Known Indirect Subclasses

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

Class Overview

An interface for objects that represent a labeled enumeration. Each such enum instance has the following characteristics:

  • A type that identifies the enum's class. For example: com.mycompany.util.FileFormat.
  • A code that uniquely identifies the enum within the context of its type. For example: "CSV". Different classes of codes are possible (e.g., Character, Integer, String).
  • A descriptive label. For example: "the CSV File Format".

Summary

Fields
public static final Comparator CODE_ORDER Shared Comparator instance that sorts enumerations by CODE_ORDER.
public static final Comparator DEFAULT_ORDER Shared Comparator instance that sorts enumerations by LABEL_ORDER, then CODE_ORDER.
public static final Comparator LABEL_ORDER Shared Comparator instance that sorts enumerations by LABEL_ORDER.
Public Methods
abstract Comparable getCode()
Return this enumeration's code.
abstract String getLabel()
Return a descriptive, optional label.
abstract Class getType()
Return this enumeration's type.
[Expand]
Inherited Methods
From interface java.lang.Comparable

Fields

public static final Comparator CODE_ORDER

Also: SpringCore

Shared Comparator instance that sorts enumerations by CODE_ORDER.

public static final Comparator DEFAULT_ORDER

Also: SpringCore

Shared Comparator instance that sorts enumerations by LABEL_ORDER, then CODE_ORDER.

public static final Comparator LABEL_ORDER

Also: SpringCore

Shared Comparator instance that sorts enumerations by LABEL_ORDER.

Public Methods

public abstract Comparable getCode ()

Also: SpringCore

Return this enumeration's code.

Each code should be unique within enumerations of the same type.

public abstract String getLabel ()

Also: SpringCore

Return a descriptive, optional label.

public abstract Class getType ()

Also: SpringCore

Return this enumeration's type.