Class StringEnumPropertyHandler
- java.lang.Object
-
- org.apache.commons.dbutils.handlers.properties.StringEnumPropertyHandler
-
- All Implemented Interfaces:
PropertyHandler
public class StringEnumPropertyHandler extends Object implements PropertyHandler
PropertyHandlerfor enums. Will convert strings to enums.
-
-
Constructor Summary
Constructors Constructor Description StringEnumPropertyHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectapply(Class<?> parameter, Object value)Stores the givenvalueinto an instance of typeparameter.booleanmatch(Class<?> parameter, Object value)Tests whether to handle settingvalueinto an instance ofparameter.
-
-
-
Constructor Detail
-
StringEnumPropertyHandler
public StringEnumPropertyHandler()
-
-
Method Detail
-
apply
public Object apply(Class<?> parameter, Object value)
Description copied from interface:PropertyHandlerStores the givenvalueinto an instance of typeparameter. This method is only called ifPropertyHandler.match(Class, Object)return true.- Specified by:
applyin interfacePropertyHandler- Parameters:
parameter- The type of the target parameter.value- The value to set.- Returns:
- The converted value or the original value if something doesn't work out.
-
match
public boolean match(Class<?> parameter, Object value)
Description copied from interface:PropertyHandlerTests whether to handle settingvalueinto an instance ofparameter.- Specified by:
matchin interfacePropertyHandler- 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.
-
-