Class EnumConverter<E extends Enum>

    • Field Detail

      • defaultValue

        protected Object defaultValue
        Default value to use if try to convert null value and flag useDefault is on.
      • useDefault

        protected boolean useDefault
        flag to use or not default value.
      • enumType

        protected Class<E extends Enum> enumType
        Enum type-safe.
    • Constructor Detail

      • EnumConverter

        public EnumConverter​(Class<E> enumType,
                             Object defaultValue)
      • EnumConverter

        public EnumConverter​(Class<E> enumType)
    • Method Detail

      • convert

        public <T> T convert​(Class<T> aClass,
                             Object value)
        Specified by:
        convert in interface org.apache.commons.beanutils.Converter
      • isEnabled

        protected static boolean isEnabled​(Class<?> aClass,
                                           Class<?> enumType)
      • convertFromOrdinal

        protected Object convertFromOrdinal​(Class<?> aClass,
                                            Object value)