Interface AsyncQueryable<T>
-
- All Superinterfaces:
AsyncSingleQueryable<T>,Queryable<T>,SingleQueryable<T>
- All Known Implementing Classes:
AsyncEntityProjectionQuery,AsyncEntityQuery
public interface AsyncQueryable<T> extends Queryable<T>, AsyncSingleQueryable<T>
- Author:
- Collin Alpert
-
-
Method Summary
Modifier and Type Method Description default java.util.concurrent.CompletableFuture<T[]>toArrayAsync()The asynchronous version of theQueryable.toArray()method.default java.util.concurrent.CompletableFuture<java.lang.Void>toArrayAsync(java.util.function.Consumer<? super T[]> callback)The asynchronous version of theQueryable.toArray()method.default java.util.concurrent.CompletableFuture<java.util.List<T>>toListAsync()The asynchronous version of theQueryable.toList()method.default java.util.concurrent.CompletableFuture<java.lang.Void>toListAsync(java.util.function.Consumer<? super java.util.List<T>> callback)The asynchronous version of theQueryable.toList()method.default java.util.concurrent.CompletableFuture<java.util.stream.Stream<T>>toStreamAsync()The asynchronous version of theQueryable.toStream()method.default java.util.concurrent.CompletableFuture<java.lang.Void>toStreamAsync(java.util.function.Consumer<? super java.util.stream.Stream<T>> callback)The asynchronous version of theQueryable.toStream()method.-
Methods inherited from interface com.github.collinalpert.java2db.queries.async.AsyncSingleQueryable
firstAsync, firstAsync
-
Methods inherited from interface com.github.collinalpert.java2db.queries.Queryable
toArray, toList, toStream
-
Methods inherited from interface com.github.collinalpert.java2db.queries.SingleQueryable
first, getQuery
-
-
-
-
Method Detail
-
toListAsync
default java.util.concurrent.CompletableFuture<java.util.List<T>> toListAsync()
The asynchronous version of theQueryable.toList()method.- Returns:
- The asynchronous operation which will retrieve the data from the database.
Custom handling for the
CompletableFuturecan be done here. - See Also:
Queryable.toList()
-
toListAsync
default java.util.concurrent.CompletableFuture<java.lang.Void> toListAsync(java.util.function.Consumer<? super java.util.List<T>> callback)
The asynchronous version of theQueryable.toList()method.- Parameters:
callback- The action to be applied to the result once it is fetched from the database.- Returns:
- The asynchronous operation which will retrieve the data from the database and apply the given action to the result.
- See Also:
Queryable.toList()
-
toStreamAsync
default java.util.concurrent.CompletableFuture<java.util.stream.Stream<T>> toStreamAsync()
The asynchronous version of theQueryable.toStream()method.- Returns:
- The asynchronous operation which will retrieve the data from the database.
Custom handling for the
CompletableFuturecan be done here. - See Also:
Queryable.toStream()
-
toStreamAsync
default java.util.concurrent.CompletableFuture<java.lang.Void> toStreamAsync(java.util.function.Consumer<? super java.util.stream.Stream<T>> callback)
The asynchronous version of theQueryable.toStream()method.- Parameters:
callback- The action to be applied to the result once it is fetched from the database.- Returns:
- The asynchronous operation which will retrieve the data from the database and apply the given action to the result.
- See Also:
Queryable.toStream()
-
toArrayAsync
default java.util.concurrent.CompletableFuture<T[]> toArrayAsync()
The asynchronous version of theQueryable.toArray()method.- Returns:
- The asynchronous operation which will retrieve the data from the database.
Custom handling for the
CompletableFuturecan be done here. - See Also:
Queryable.toArray()
-
toArrayAsync
default java.util.concurrent.CompletableFuture<java.lang.Void> toArrayAsync(java.util.function.Consumer<? super T[]> callback)
The asynchronous version of theQueryable.toArray()method.- Parameters:
callback- The action to be applied to the result once it is fetched from the database.- Returns:
- The asynchronous operation which will retrieve the data from the database and apply the given action to the result.
- See Also:
Queryable.toArray()
-
-