-
- All Implemented Interfaces:
public final class ExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static BooleanisKotlinClass(Class<?> $self)final static <T extends JdbiConfig<T>> TgetConfig(StatementContext $self, KClass<T> kClass)Convenience helper to use KClass<T> for config lookup. final static <T extends Any> ResultIterable<T>mapTo(ResultBearing $self)final static <O extends Any> UnituseSequence(ResultIterable<O> $self, Function1<Sequence<O>, Unit> block)final static <This extends SqlStatement<This>> ThisbindKotlin(SqlStatement<This> $self, String name, Object obj)final static <This extends SqlStatement<This>> ThisbindKotlin(SqlStatement<This> $self, Object obj)final static <This extends Configurable<This>, C extends JdbiConfig<C>> Thisconfigure(Configurable<This> $self, KClass<C> configClass, Consumer<C> configurer)Convenience method for {@link Configurable#configure} using Kotlin class syntax. final static <E extends Any, R extends Any, X extends Exception> RwithExtension(Jdbi $self, KClass<E> extensionType, ExtensionCallback<R, E, X> callback)A convenience method which opens an extension of the given type, yields it to a callback, and returns the result of the callback. final static <E extends Any, X extends Exception> UnituseExtension(Jdbi $self, KClass<E> extensionType, ExtensionConsumer<E, X> callback)A convenience method which opens an extension of the given type, and yields it to a callback. final static Set<Annotation>getQualifiers(KAnnotatedElement elements)Returns the set of qualifying annotations on the given Kotlin elements. -
-
Method Detail
-
isKotlinClass
final static Boolean isKotlinClass(Class<?> $self)
-
getConfig
final static <T extends JdbiConfig<T>> T getConfig(StatementContext $self, KClass<T> kClass)
Convenience helper to use KClass<T> for config lookup.
-
useSequence
final static <O extends Any> Unit useSequence(ResultIterable<O> $self, Function1<Sequence<O>, Unit> block)
-
bindKotlin
final static <This extends SqlStatement<This>> This bindKotlin(SqlStatement<This> $self, String name, Object obj)
-
bindKotlin
final static <This extends SqlStatement<This>> This bindKotlin(SqlStatement<This> $self, Object obj)
-
configure
final static <This extends Configurable<This>, C extends JdbiConfig<C>> This configure(Configurable<This> $self, KClass<C> configClass, Consumer<C> configurer)
Convenience method for {@link Configurable#configure} using Kotlin class syntax.
-
withExtension
final static <E extends Any, R extends Any, X extends Exception> R withExtension(Jdbi $self, KClass<E> extensionType, ExtensionCallback<R, E, X> callback)
A convenience method which opens an extension of the given type, yields it to a callback, and returns the result of the callback. A handle is opened if needed by the extension, and closed before returning to the caller.
- Parameters:
extensionType- the type of extension.callback- a callback which will receive the extension.
-
useExtension
final static <E extends Any, X extends Exception> Unit useExtension(Jdbi $self, KClass<E> extensionType, ExtensionConsumer<E, X> callback)
A convenience method which opens an extension of the given type, and yields it to a callback. A handle is opened if needed by the extention, and closed before returning to the caller.
- Parameters:
extensionType- the type of extensioncallback- a callback which will receive the extension
-
getQualifiers
final static Set<Annotation> getQualifiers(KAnnotatedElement elements)
Returns the set of qualifying annotations on the given Kotlin elements.
- Parameters:
elements- the annotated element.
-
-
-
-