Package org.jdbi.v3.core.interceptor
Interface JdbiInterceptor<S,T>
- Type Parameters:
S
- A generic source type.T
- A generic destination type.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Generic interface to allow transformation operation interception. Used to manage the various inferred data types that may need special treatment.
-
Method Summary
-
Method Details
-
intercept
Process a given source object.- If the interceptor wants to process the object, return the result directly.
- If the interceptor passes on processing, it must return
JdbiInterceptionChain.next()
class SomeInterceptor implements JdbiInterceptor<Foo, Bar> { @Override public Bar intercept(Foo source, JdbiInterceptionChain<Foo, Bar> chain) { if (source != null && source.isBarCompatible()) { return new Bar(source); } else { return chain.next(); } } }
- Parameters:
source
- A source object.- Returns:
- The destination type.
-