Class DefaultFallbackDecorator

java.lang.Object
io.github.resilience4j.fallback.DefaultFallbackDecorator
All Implemented Interfaces:
FallbackDecorator

public class DefaultFallbackDecorator
extends java.lang.Object
implements FallbackDecorator
default fallbackMethod decorator. it catches throwable and invoke the fallbackMethod method.
  • Constructor Summary

    Constructors 
    Constructor Description
    DefaultFallbackDecorator()  
  • Method Summary

    Modifier and Type Method Description
    io.vavr.CheckedFunction0<java.lang.Object> decorate​(FallbackMethod fallbackMethod, io.vavr.CheckedFunction0<java.lang.Object> supplier)  
    boolean supports​(java.lang.Class<?> target)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • supports

      public boolean supports​(java.lang.Class<?> target)
      Specified by:
      supports in interface FallbackDecorator
    • decorate

      public io.vavr.CheckedFunction0<java.lang.Object> decorate​(FallbackMethod fallbackMethod, io.vavr.CheckedFunction0<java.lang.Object> supplier)
      Specified by:
      decorate in interface FallbackDecorator
      Parameters:
      fallbackMethod - fallback method.
      supplier - target function should be decorated.
      Returns:
      decorated function