Class FailurePolicy<T>

java.lang.Object
io.vertx.mutiny.circuitbreaker.FailurePolicy<T>
All Implemented Interfaces:
MutinyDelegate

public class FailurePolicy<T> extends Object implements MutinyDelegate
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.mutiny.circuitbreaker.FailurePolicy<T>).

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

  • Field Details

  • Constructor Details

    • FailurePolicy

      public FailurePolicy(io.vertx.circuitbreaker.FailurePolicy delegate)
    • FailurePolicy

      public FailurePolicy(Object delegate, TypeArg<T> typeArg_0)
    • FailurePolicy

      public FailurePolicy(io.vertx.circuitbreaker.FailurePolicy delegate, TypeArg<T> typeArg_0)
  • Method Details

    • getDelegate

      public io.vertx.circuitbreaker.FailurePolicy getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • 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
    • defaultPolicy

      public static <U> FailurePolicy<U> defaultPolicy()
      Returns:
    • test

      public boolean test(io.smallrye.mutiny.Uni<T> future)
      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(io.vertx.circuitbreaker.FailurePolicy arg)
    • newInstance

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