Package io.vertx.core

## Interface Completable<T>

- All Known Subinterfaces:
    `BaseBridgeEvent`, `BridgeEvent`, `BridgeEvent`, `ConnectionInitEvent`, `Promise<T>`
  Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public interface Completable<T>

  A view of something that can be completed with a success or failure.
  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `complete​(T result, Throwable failure)` | Complete this instance when `failure` is `null`, a success is signaled otherwise a failure is signaled
    `default void` | `fail​(String message)` | Calls `fail(Throwable)` with the `message`.
    `default void` | `fail​(Throwable failure)` | Set the failure.
    `default void` | `succeed()` | Shortcut for `succeed(null)`
    `default void` | `succeed​(T result)` | Set the result.

- - ### Method Detail

    - #### succeed

          default void succeed​(T result)

      Set the result. The instance will be marked as succeeded and completed.

      Parameters:
        `result` - the result
      Throws:
        `IllegalStateException` - when this instance is already completed or failed

    - #### succeed

          default void succeed()

      Shortcut for `succeed(null)`
      Throws:
        `IllegalStateException` - when this instance is already completed or failed

    - #### fail

          default void fail​(Throwable failure)

      Set the failure. This instance will be marked as failed and completed.
      Parameters:
        `failure` - the failure
      Throws:
        `IllegalStateException` - when this instance is already completed or failed

    - #### fail

          default void fail​(String message)

      Calls `fail(Throwable)` with the `message`.
      Parameters:
        `message` - the failure message
      Throws:
        `IllegalStateException` - when this instance is already completed or failed

    - #### complete

          void complete​(T result,
                        Throwable failure)

      Complete this instance
      - when `failure` is `null`, a success is signaled
      - otherwise a failure is signaled
      Parameters:
        `result` - the result
        `failure` - the failure
      Throws:
        `IllegalStateException` - when this instance is already completed