public abstract class

StaticLabeledEnum

extends AbstractLabeledEnum
java.lang.Object
   ↳ org.springframework.core.enums.AbstractLabeledEnum
     ↳ org.springframework.core.enums.StaticLabeledEnum

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

Class Overview

Base class for static type-safe labeled enum instances. Usage example:

 public class FlowSessionStatus extends StaticLabeledEnum {

     // public static final instances!
     public static FlowSessionStatus CREATED = new FlowSessionStatus(0, "Created");
     public static FlowSessionStatus ACTIVE = new FlowSessionStatus(1, "Active");
     public static FlowSessionStatus PAUSED = new FlowSessionStatus(2, "Paused");
     public static FlowSessionStatus SUSPENDED = new FlowSessionStatus(3, "Suspended");
     public static FlowSessionStatus ENDED = new FlowSessionStatus(4, "Ended");
     
     // private constructor!
     private FlowSessionStatus(int code, String label) {
         super(code, label);
     }
     
     // custom behavior
 }

Summary

[Expand]
Inherited Fields
From interface org.springframework.core.enums.LabeledEnum
Protected Constructors
StaticLabeledEnum(int code, String label)
Create a new StaticLabeledEnum instance.
Public Methods
Comparable getCode()
String getLabel()
short shortValue()
Return the code of this LabeledEnum instance as a short.
Protected Methods
Object readResolve()
Return the resolved type safe static enum instance.
[Expand]
Inherited Methods
From class org.springframework.core.enums.AbstractLabeledEnum
From class java.lang.Object
From interface java.lang.Comparable
From interface org.springframework.core.enums.LabeledEnum

Protected Constructors

protected StaticLabeledEnum (int code, String label)

Also: SpringCore

Create a new StaticLabeledEnum instance.

Parameters
code the short code
label the label (can be null)

Public Methods

public Comparable getCode ()

Also: SpringCore

public String getLabel ()

Also: SpringCore

public short shortValue ()

Also: SpringCore

Return the code of this LabeledEnum instance as a short.

Protected Methods

protected Object readResolve ()

Also: SpringCore

Return the resolved type safe static enum instance.