Class StatementCompletionStage<T>

  • Type Parameters:
    T - held value type

    public final class StatementCompletionStage<T>
    extends Object
    Represents a statement completion stage.
    • Method Detail

      • sync

        public T sync()
        Executes the completion stage synchronously
        Returns:
        held value type
      • sync

        public T sync​(Function<Throwable,​T> onError)
        Executes the completion stage synchronously, providing callback to onError
        Parameters:
        onError - on error
        Returns:
        held value type, or if exception, the value returned from onError
      • async

        public void async()
        Executes the completion stage asynchronously without providing a callback.
      • async

        public void async​(Consumer<T> onSuccess)
        Executes the completion stage asynchronously if async executor is present
        Parameters:
        onSuccess - on success callback
      • async

        public void async​(Consumer<T> onSuccess,
                          Consumer<Throwable> onError)
        Executes the completion stage asynchronously if async executor is present, also providing you with onError consumer.
        Parameters:
        onSuccess - on success callback
        onError - on error callback
      • complete

        public void complete​(BiConsumer<T,​Throwable> consumer)
        Completes the statement synchronously, providing you with a combined callback for error and value.
        Parameters:
        consumer - callback
      • completeAsync

        public void completeAsync​(BiConsumer<T,​Throwable> consumer)
        Completes the statement asynchronously, providing you with a combined callback for error and value.
        Parameters:
        consumer - callback