Package 

Class ExtensionsKt

  • All Implemented Interfaces:

    
    public final class ExtensionsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Boolean isKotlinClass(Class<?> $self) Returns true if the Class object represents a Kotlin class.
      final static <T extends JdbiConfig<T>> T getConfig(StatementContext $self, KClass<T> kClass) Convenience helper to use any KClass for config lookup.
      final static <T extends Any> ResultIterable<T> mapTo(ResultBearing $self) Use a reified parameter to map the result.
      final static <T extends Any> ResultIterable<T> mapTo(ResultBearing $self, KClass<T> kClass) Map to a Kotlin class.
      final static <O extends Any> Unit useSequence(ResultIterable<O> $self, Function1<Sequence<O>, Unit> block) Stream all the rows of the result set out with a Sequence.
      final static <This extends SqlStatement<This>> This bindKotlin(SqlStatement<This> $self, String prefix, Object obj) Bind all the member properties of a given Kotlin object.
      final static <This extends SqlStatement<This>> This bindKotlin(SqlStatement<This> $self, Object obj) Bind all the member properties of a given Kotlin object.
      final static <This extends Configurable<This>, C extends JdbiConfig<C>> This configure(Configurable<This> $self, KClass<C> configClass, Consumer<C> configurer) Convenience method for Configurable.configure using Kotlin class syntax.
      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.
      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.
      final static Set<Annotation> getQualifiers(KAnnotatedElement elements) Returns the set of qualifying annotations on the given Kotlin elements.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getConfig

         final static <T extends JdbiConfig<T>> T getConfig(StatementContext $self, KClass<T> kClass)

        Convenience helper to use any KClass for config lookup.

      • mapTo

         final static <T extends Any> ResultIterable<T> mapTo(ResultBearing $self)

        Use a reified parameter to map the result.

      • mapTo

         final static <T extends Any> ResultIterable<T> mapTo(ResultBearing $self, KClass<T> kClass)

        Map to a Kotlin class.

        Parameters:
        kClass - the type to map the result set rows to.
      • useSequence

         final static <O extends Any> Unit useSequence(ResultIterable<O> $self, Function1<Sequence<O>, Unit> block)

        Stream all the rows of the result set out with a Sequence. Handles closing of the underlying iterator.

        handle.createQuery(...).mapTo<Result>().useSequence { var firstResult = it.first() }
      • bindKotlin

         final static <This extends SqlStatement<This>> This bindKotlin(SqlStatement<This> $self, String prefix, Object obj)

        Bind all the member properties of a given Kotlin object.

        Parameters:
        prefix - A prefix for the property names.
        obj - The object to bind.
      • bindKotlin

         final static <This extends SqlStatement<This>> This bindKotlin(SqlStatement<This> $self, Object obj)

        Bind all the member properties of a given Kotlin object.

        Parameters:
        obj - The object to bind.
      • 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 Configurable.configure using Kotlin class syntax.

        Parameters:
        configClass - – the configuration type
        configurer - – consumer that will be passed the configuration object
      • 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 extension
        callback - a callback which will receive the extension