io.vertx.rxjava3.circuitbreaker

## Class FailurePolicy<T>

- java.lang.Object
- - io.vertx.rxjava3.circuitbreaker.FailurePolicy<T>

- All Implemented Interfaces:
    io.vertx.lang.rx.RxDelegate

      public class FailurePolicy<T>
      extends Object
      implements io.vertx.lang.rx.RxDelegate

  A failure policy for the `CircuitBreaker`.

  The default policy is to consider an asynchronous result as a failure if returns `true`. Nevertheless, sometimes this is not good enough. For example, an HTTP Client could return a response, but with an unexpected status code.

  In this case, a custom failure policy can be configured with `CircuitBreaker.failurePolicy(io.vertx.rxjava3.circuitbreaker.FailurePolicy<T>)`.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<FailurePolicy>` | `__TYPE_ARG`
    `io.vertx.lang.rx.TypeArg<T>` | `__typeArg_0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FailurePolicy(FailurePolicy delegate)`
    `FailurePolicy(Object delegate, io.vertx.lang.rx.TypeArg<T> typeArg_0)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <U> FailurePolicy<U>` | `defaultPolicy()` The default policy, which considers an asynchronous result as a failure if returns `true`.
    `boolean` | `equals(Object o)`
    `FailurePolicy` | `getDelegate()`
    `int` | `hashCode()`
    `static <T> FailurePolicy<T>` | `newInstance(FailurePolicy arg)`
    `static <T> FailurePolicy<T>` | `newInstance(FailurePolicy arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)`
    `boolean` | `test(Single<T> future)` Invoked by the `CircuitBreaker` when an operation completes.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<FailurePolicy> __TYPE_ARG

    - #### __typeArg_0

          public final io.vertx.lang.rx.TypeArg<T> __typeArg_0

  - ### Constructor Detail

    - #### FailurePolicy

          public FailurePolicy(FailurePolicy delegate)

    - #### FailurePolicy

          public FailurePolicy(Object delegate,
                               io.vertx.lang.rx.TypeArg<T> typeArg_0)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public FailurePolicy getDelegate()

      Specified by:
        `getDelegate` in interface `io.vertx.lang.rx.RxDelegate`

    - #### defaultPolicy

          public static <U> FailurePolicy<U> defaultPolicy()

      The default policy, which considers an asynchronous result as a failure if returns `true`.
      Returns:

    - #### test

          public boolean test(Single<T> future)

      Invoked by the `CircuitBreaker` when an operation completes.
      Parameters:
        `future` - a completed future
      Returns:
        `true` if the asynchronous result should be considered as a failure, `false` otherwise

    - #### newInstance

          public static <T> FailurePolicy<T> newInstance(FailurePolicy arg)

    - #### newInstance

          public static <T> FailurePolicy<T> newInstance(FailurePolicy arg,
                                                         io.vertx.lang.rx.TypeArg<T> __typeArg_T)

Copyright © 2025 Eclipse. All rights reserved.