Interface JdbiInterceptor<S,T>

Type Parameters:
S - Transformation source type.
T - Type of the transformation result.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Alpha @FunctionalInterface public interface JdbiInterceptor<S,T>
Generic interface to allow transformation operation interception. Used to manage the various inferred data types that may need special treatment.
  • Method Summary

    Modifier and Type
    Process a given source object.
  • Method Details

    • intercept

      @CheckForNull T intercept(@Nullable S source, JdbiInterceptionChain<T> chain)
      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
        class SomeInterceptor implements JdbiInterceptor<Foo, Bar> {
            public Bar intercept(Foo source, JdbiInterceptionChain<Foo, Bar> chain) {
                if (source != null && source.isBarCompatible()) {
                    return new Bar(source);
                } else {
      source - A source object.
      The destination type.