org.springframework.core.enums

Class ShortCodedLabeledEnum

  • All Implemented Interfaces:
    Serializable, Comparable, LabeledEnum
    Deprecated. 
    as of Spring 3.0, in favor of Java 5 enums.

    @Deprecated
    public class ShortCodedLabeledEnum
    extends AbstractGenericLabeledEnum
    Implementation of LabeledEnum which uses Short as the code type.

    Should almost always be subclassed, but for some simple situations it may be used directly. Note that you will not be able to use unique type-based functionality like LabeledEnumResolver.getLabeledEnumSet(type) in this case.

    Since:
    1.2.2
    Author:
    Keith Donald
    See Also:
    Serialized Form
    • Constructor Detail

      • ShortCodedLabeledEnum

        public ShortCodedLabeledEnum(int code,
                             String label)
        Deprecated. 
        Create a new ShortCodedLabeledEnum instance.
        Parameters:
        code - the short code
        label - the label (can be null)
    • Method Detail

      • getCode

        public Comparable getCode()
        Deprecated. 
        Description copied from interface: LabeledEnum
        Return this enumeration's code.

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

      • getShortCode

        public short getShortCode()
        Deprecated. 
        Return the short code of this LabeledEnum instance.