Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.ng.wire

# 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

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static final class`
`AsyncFetchStatus.CompletedWithException`
Signals an async fetch which completed with an exception.
`static final class`
`AsyncFetchStatus.NonePending`
Signals no async fetch pending.
`static class`
`AsyncFetchStatus.Pending`
Signals an async fetch pending.

## Method Summary

Modifier and Type
Method
Description
`static AsyncFetchStatus`
`completed()`
`static AsyncFetchStatus`
`completedWithException(SQLException exception)`
`default Optional<SQLException>`
`exception()`
`boolean`
`isPending()`
Is this a status signalling an async fetch is pending (which includes having completed with an exception).
`static AsyncFetchStatus`
`nonePending()`
`static AsyncFetchStatus`
`pending()`

## 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:
  - `nonePending()`
  - `completedWithException(SQLException)`

### 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