Class JdbiInterceptionChainHolder<S,T>
java.lang.Object
org.jdbi.v3.core.interceptor.JdbiInterceptionChainHolder<S,T>
-
Constructor Summary
ConstructorDescriptionCreates a new chain holder.JdbiInterceptionChainHolder
(Function<S, T> defaultTransformer) Creates a new chain holder with a default interceptor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFirst
(JdbiInterceptor<S, T> interceptor) Registers a new interceptor at the beginning of the chain.void
addLast
(JdbiInterceptor<S, T> interceptor) Registers a new interceptor at the end of the chain.Processes a source object and returns a target object.
-
Constructor Details
-
JdbiInterceptionChainHolder
-
JdbiInterceptionChainHolder
public JdbiInterceptionChainHolder()Creates a new chain holder. ThrowsUnsupportedOperationException
if no registered interceptor processes a source object. -
JdbiInterceptionChainHolder
-
-
Method Details
-
process
Processes a source object and returns a target object.- Parameters:
source
- A source object.- Returns:
- A target object processed by one of the registered
JdbiInterceptor
instances.
-
addFirst
Registers a new interceptor at the beginning of the chain. Any subsequent call toprocess(Object)
will use this interceptor before all other already registered interceptors.- Parameters:
interceptor
- An object implementingJdbiInterceptor
.
-
addLast
Registers a new interceptor at the end of the chain. Any subsequent call toprocess(Object)
will use this interceptor after all other already registered interceptors.- Parameters:
interceptor
- An object implementingJdbiInterceptor
.
-