Class EnumConversionHelper

  • public class EnumConversionHelper
    extends Object
    Helper class providing conversion methods for use with enums.
    • Constructor Detail

      • EnumConversionHelper

        public EnumConversionHelper()
    • Method Detail

      • getStoredValueFromEnum

        public static Object getStoredValueFromEnum​(AbstractMemberMetaData mmd,
                                                    FieldRole role,
                                                    Enum myEnum)
        Convenience method to return the "value" of an Enum, for a field and role. Firstly checks for a defined method on the Enum that returns the "value", otherwise falls back to use the ordinal.
        mmd - Metadata for the member
        role - Role of the Enum in this member
        myEnum - The enum
        The "value" (String or Integer)