- 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 ClassesModifier and TypeInterfaceDescriptionstatic final class
Signals an async fetch which completed with an exception.static final class
Signals no async fetch pending.static class
Signals an async fetch pending. -
Method Summary
Modifier and TypeMethodDescriptionstatic AsyncFetchStatus
static AsyncFetchStatus
completedWithException
(SQLException exception) default Optional<SQLException>
boolean
Is this a status signalling an async fetch is pending (which includes having completed with an exception).static AsyncFetchStatus
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
- Returns:
- exception from the last unsuccessfully completed asynchronous fetch
-
nonePending
- Returns:
- status instance which represents no asynchronous fetch is pending
-
pending
- Returns:
- status instance which represents a pending asynchronous fetch
-
completed
- Returns:
- status instance which represents a successfully completed asynchronous fetch (same as
nonePending()
) - See Also:
-
completedWithException
- 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
-