Interface AsyncFetchStatus

All Known Implementing Classes:
AsyncFetchStatus.CompletedWithException, AsyncFetchStatus.NonePending, AsyncFetchStatus.Pending

public sealed interface AsyncFetchStatus permits AsyncFetchStatus.NonePending, AsyncFetchStatus.Pending
Asynchronous fetch status.
Since:
6
Author:
Mark Rotteveel
  • Method Details

    • isPending

      boolean isPending()
      Is this a status signalling an async fetch is pending (which includes having completed with an exception).
      Returns:
      true if this status is pending
    • exception

      default Optional<SQLException> exception()
      Returns:
      exception from the last unsuccessfully completed asynchronous fetch
    • nonePending

      static AsyncFetchStatus nonePending()
      Returns:
      status instance which represents no asynchronous fetch is pending
    • pending

      static AsyncFetchStatus pending()
      Returns:
      status instance which represents a pending asynchronous fetch
    • completed

      static AsyncFetchStatus completed()
      Returns:
      status instance which represents a successfully completed asynchronous fetch (same as nonePending())
      See Also:
    • completedWithException

      static AsyncFetchStatus completedWithException(SQLException exception)
      Parameters:
      exception - exception resulting from the asynchronous completion
      Returns:
      status instance which represents an asynchronous fetch which completed with an exception; this is considered a still pending operation, where the pending action is throwing the exception