Class CancelableOperation<T extends @Nullable Object>
java.lang.Object
com.vaadin.flow.signals.operations.SignalOperation<T>
com.vaadin.flow.signals.operations.CancelableOperation<T>
- Type Parameters:
T- the result type
- All Implemented Interfaces:
Serializable
An operation that can be cancelled.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.signals.operations.SignalOperation
SignalOperation.Error<T extends @Nullable Object>, SignalOperation.Result<T extends @Nullable Object>, SignalOperation.ResultOrError<T extends @Nullable Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels this operation.booleanChecks whether this operation has been canceled.<R> CancelableOperation<R> map(SerializableFunction<T, R> mapper) Creates a new cancelable operation that transforms the result value using the given mapper function.Methods inherited from class com.vaadin.flow.signals.operations.SignalOperation
forwardMappedResult, result
-
Constructor Details
-
CancelableOperation
public CancelableOperation()Creates a new cancelable operation.
-
-
Method Details
-
cancel
public void cancel()Cancels this operation. Note that there's still a possibility that the operation will be successfully resolved rather than canceled if resolution and cancel happen concurrently. -
isCancelled
public boolean isCancelled()Checks whether this operation has been canceled.- Returns:
trueif the operation is canceled
-
map
Creates a new cancelable operation that transforms the result value using the given mapper function. Cancelling the returned operation will also cancel this operation. If this operation fails, the mapped operation will also fail with the same error.- Overrides:
mapin classSignalOperation<T extends @Nullable Object>- Type Parameters:
R- the mapped result type- Parameters:
mapper- the function to transform the result value, notnull- Returns:
- a new cancelable operation with the mapped result, not
null
-