Class CancelableOperation<T>

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

public class CancelableOperation<T> extends SignalOperation<T>
An operation that can be cancelled.
See Also:
  • 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:
      true if the operation is canceled
    • map

      public <R> CancelableOperation<R> map(SerializableFunction<T,R> mapper)
      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:
      map in class SignalOperation<T>
      Type Parameters:
      R - the mapped result type
      Parameters:
      mapper - the function to transform the result value, not null
      Returns:
      a new cancelable operation with the mapped result, not null