Package org.jdbi.v3.core.extension
Interface ExtensionHandlerFactory
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether the factory can create anExtensionHandler
for combination of extension type and method.createExtensionHandler
(Class<?> extensionType, Method method) Returns anExtensionHandler
instance for a extension type and method combination.
-
Method Details
-
accepts
Determines whether the factory can create anExtensionHandler
for combination of extension type and method.- Parameters:
extensionType
- The extension type classmethod
- A method- Returns:
- True if the factory can create an extension handler for extension type and method, false otherwise
-
createExtensionHandler
Returns anExtensionHandler
instance for a extension type and method combination.- Parameters:
extensionType
- The extension type classmethod
- A method- Returns:
- An
ExtensionHandler
instance wrapped into anOptional
. The optional can be empty. This is necessary to retrofit old code that does not have an accept/build code pair but unconditionally tries to build a handler and returns empty if it can not. New code should always returnOptional.of(extensionHandler}
and never returnOptional.empty()
-