-
- Type Parameters:
T
- the type of the result of theOperation
- All Superinterfaces:
Operation<T>
,PrimitiveOperation<T>
- All Known Subinterfaces:
ParameterizedRowCountOperation<T>
public interface RowCountOperation<T> extends Operation<T>
AnOperation
that returns a count.- See Also:
ParameterizedRowCountOperation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RowCountOperation<T>
apply(java.util.function.Function<Result.RowCount,? extends T> function)
Sets the result processor for thisOperation
.RowCountOperation<T>
onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
.RowCountOperation<T>
timeout(java.time.Duration minTime)
The minimum time before thisOperation
might be canceled automatically.-
Methods inherited from interface jdk.incubator.sql2.PrimitiveOperation
submit
-
-
-
-
Method Detail
-
apply
RowCountOperation<T> apply(java.util.function.Function<Result.RowCount,? extends T> function)
Sets the result processor for thisOperation
.- Parameters:
function
- processes the count produced by executing thisOperation
and returns the result- Returns:
- this
RowCountOperation
- Throws:
java.lang.IllegalStateException
- if this method has been called previously
-
onError
RowCountOperation<T> onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
. If execution of thisOperation
results in an error, before theOperation
is completed, the handler is called with theThrowable
as the argument. The type of theThrowable
is implementation dependent.
-
timeout
RowCountOperation<T> timeout(java.time.Duration minTime)
The minimum time before thisOperation
might be canceled automatically. The default value is forever. The time is counted from the beginning of Operation execution. The Operation will not be canceled beforeminTime
after the beginning of execution. Some time at leastminTime
after the beginning of execution, an attempt will be made to cancel theOperation
if it has not yet completed. Implementations are encouraged to attempt to cancel within a reasonable time, though what is reasonable is implementation dependent.
-
-