Class StringEnumPropertyHandler

java.lang.Object
org.apache.commons.dbutils.handlers.properties.StringEnumPropertyHandler
All Implemented Interfaces:
PropertyHandler

public class StringEnumPropertyHandler extends Object implements PropertyHandler
PropertyHandler for enums. Will convert strings to enums.
  • Constructor Details

    • StringEnumPropertyHandler

      public StringEnumPropertyHandler()
  • Method Details

    • match

      public boolean match(Class<?> parameter, Object value)
      Description copied from interface: PropertyHandler
      Test whether this PropertyHandler wants to handle setting value into something of type parameter.
      Specified by:
      match in interface PropertyHandler
      Parameters:
      parameter - The type of the target parameter.
      value - The value to be set.
      Returns:
      true is this property handler can/wants to handle this value; false otherwise.
    • apply

      public Object apply(Class<?> parameter, Object value)
      Description copied from interface: PropertyHandler
      Do the work required to store value into something of type parameter. This method is called only if this handler responded true after a call to PropertyHandler.match(Class, Object).
      Specified by:
      apply in interface PropertyHandler
      Parameters:
      parameter - The type of the target parameter.
      value - The value to be set.
      Returns:
      The converted value or the original value if something doesn't work out.