Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| The Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.core.enums
Interface LabeledEnum

All Superinterfaces:
  Comparable, Serializable

All Known Implementing Classes:
  AbstractGenericLabeledEnum, AbstractLabeledEnum, LetterCodedLabeledEnum, ShortCodedLabeledEnum, StaticLabeledEnum, StringCodedLabeledEnum

    public interface LabeledEnum

extends Comparable, Serializable

A interface for objects that represent a labled 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 (Character, Integer, String).
- A descriptive label. For example: "the CSV File Format".

Since:
  1.2.2
Author:
  Keith Donald

Field Summary
`static Comparator` | `CODE_ORDER` Shared Comparator instance that sorts enumerations by `CODE_ORDER`.
`static Comparator` | `DEFAULT_ORDER` Shared Comparator instance that sorts enumerations by `LABEL_ORDER`, then `CODE_ORDER`.
`static Comparator` | `LABEL_ORDER` Shared Comparator instance that sorts enumerations by `LABEL_ORDER`.

Method Summary
`Comparable` | `getCode()` Return this enumeration's code.
`String` | `getLabel()` Return a descriptive, optional label.
`Class` | `getType()` Return this enumeration's type.

Methods inherited from interface java.lang.Comparable
`compareTo`

Field Detail

### CODE_ORDER

    static final Comparator CODE_ORDER

  Shared Comparator instance that sorts enumerations by `CODE_ORDER`.

### LABEL_ORDER

    static final Comparator LABEL_ORDER

  Shared Comparator instance that sorts enumerations by `LABEL_ORDER`.

### DEFAULT_ORDER

    static final Comparator DEFAULT_ORDER

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

Method Detail

### getType

    Class getType()

  Return this enumeration's type.

### getCode

    Comparable getCode()

  Return this enumeration's code.

  Each code should be unique within enumeration's of the same type.

### getLabel

    String getLabel()

  Return a descriptive, optional label.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| The Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2007 The Spring Framework.