Class RxFunction

java.lang.Object
io.github.venkateshamurthy.exceptional.RxFunction

public class RxFunction extends Object
A utility to wrap Function, BiFunction, CheckedFunction and CheckedBiFunction
  • Constructor Details

    • RxFunction

      public RxFunction()
  • Method Details

    • toBinaryOperator

      public static <X> BinaryOperator<X> toBinaryOperator(BinaryOperator<X> binary)
      A reflexive function for BinaryOperator
      Type Parameters:
      X - type of input and output
      Parameters:
      binary - usually a lambda expression representing BinaryOperator
      Returns:
      the same as input
    • toBinaryOperator

      public static <X> BinaryOperator<X> toBinaryOperator(BiFunction<X,X,X> biFunction)
      A converter for BiFunction whose arguments and output are of same type thus naturally to BinaryOperator
      Type Parameters:
      X - type of input and output
      Parameters:
      biFunction - usually a lambda expression representing BiFunction whose arguments and output are of same type
      Returns:
      the same as input after apply
    • toUnaryOperator

      public static <X> UnaryOperator<X> toUnaryOperator(UnaryOperator<X> unary)
      A reflexive function for a UnaryOperator
      Type Parameters:
      X - type of input and output
      Parameters:
      unary - usually a lambda expression representing UnaryOperator
      Returns:
      the same as input
    • toUnaryOperator

      public static <X> UnaryOperator<X> toUnaryOperator(Function<X,X> function)
      A converter for Function whose argument and output are of same type thus naturally to UnaryOperator
      Type Parameters:
      X - type of input and output
      Parameters:
      function - usually a lambda expression representing Function whose argument and output are of same type
      Returns:
      the same as input after apply
    • toFunction

      public static <T, R> Function<T,R> toFunction(Function<T,R> function)
      Reflexive convenience method for chaining
      Type Parameters:
      T - type of input
      R - type of result
      Parameters:
      function - to be seen as Function
      Returns:
      function
    • toCheckedFunction

      public static <T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> toCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> function)
      Reflexive convenience method for chaining
      Type Parameters:
      T - type of input
      R - type of result
      Parameters:
      function - to be seen as CheckedFunction
      Returns:
      function as is
    • toBiFunction

      public static <T, T2, R> BiFunction<T,T2,R> toBiFunction(BiFunction<T,T2,R> function)
      Reflexive convenience method for chaining
      Type Parameters:
      T - type of input
      T2 - 2nd type
      R - type of result
      Parameters:
      function - to be seen as BiFunction
      Returns:
      function as is
    • toCheckedBiFunction

      public static <T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> toCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> function)
      Reflexive convenience method for chaining
      Type Parameters:
      T - type of input
      T2 - 2nd type
      R - type of result
      Parameters:
      function - to be seen as CheckedBiFunction
      Returns:
      function as is
    • retryFunction

      public static <T, R> Function<T,R> retryFunction(Function<T,R> function, io.github.resilience4j.retry.Retry retry)
      Retry function wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      function - a Function<T,R> to be retried
      retry - a Retry instance
      Returns:
      wrapped function
    • rateLimitFunction

      public static <T, R> Function<T,R> rateLimitFunction(Function<T,R> function, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
      RateLimiting function wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      function - a Function<T,R> to be retried
      rateLimiter - a RateLimiter instance
      Returns:
      wrapped function
    • circuitBreakFunction

      public static <T, R> Function<T,R> circuitBreakFunction(Function<T,R> function, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker)
      CircuitBreaker function wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      function - a Function<T,R> to be retried
      circuitBreaker - a CircuitBreaker instance
      Returns:
      wrapped function
    • bulkheadFunction

      public static <T, R> Function<T,R> bulkheadFunction(Function<T,R> function, io.github.resilience4j.bulkhead.Bulkhead bulkhead)
      Bulkhead function wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      function - a Function<T,R> to be retried
      bulkhead - a Bulkhead instance
      Returns:
      wrapped function
    • retryCheckedFunction

      public static <T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> retryCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> checkedFunction, io.github.resilience4j.retry.Retry retry)
      Retry CheckedFunction wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      checkedFunction - a io.github.resilience4j.core.functions.CheckedFunction<T,R> to be retried
      retry - a Retry instance
      Returns:
      wrapped checkedFunction
    • rateLimitCheckedFunction

      public static <T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> rateLimitCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> checkedFunction, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
      Ratelimiting CheckedFunction wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      checkedFunction - a io.github.resilience4j.core.functions.CheckedFunction<T,R> to be retried
      rateLimiter - a RateLimiter instance
      Returns:
      wrapped checkedFunction
    • circuitBreakCheckedFunction

      public static <T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> circuitBreakCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> checkedFunction, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker)
      Circuitbreaker CheckedFunction wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      checkedFunction - a io.github.resilience4j.core.functions.CheckedFunction<T,R> to be retried
      circuitBreaker - a CircuitBreaker instance
      Returns:
      wrapped checkedFunction
    • bulkheadCheckedFunction

      public static <T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> bulkheadCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> checkedFunction, io.github.resilience4j.bulkhead.Bulkhead bulkhead)
      Bulkhead CheckedFunction wrapper
      Type Parameters:
      T - input type
      R - output type
      Parameters:
      checkedFunction - a io.github.resilience4j.core.functions.CheckedFunction<T,R> to be retried
      bulkhead - a Bulkhead instance
      Returns:
      wrapped checkedFunction
    • retryBiFunction

      public static <T, T2, R> BiFunction<T,T2,R> retryBiFunction(BiFunction<T,T2,R> biFunction, io.github.resilience4j.retry.Retry retry)
      Retry BiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      biFunction - a BiFunction<T,T2,R> to be retried
      retry - a Retry instance
      Returns:
      wrapped biFunction
    • rateLimitBiFunction

      public static <T, T2, R> BiFunction<T,T2,R> rateLimitBiFunction(BiFunction<T,T2,R> biFunction, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
      Ratelimiter BiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      biFunction - a BiFunction<T,T2,R> to be retried
      rateLimiter - a RateLimiter instance
      Returns:
      wrapped biFunction
    • circuitBreakBiFunction

      public static <T, T2, R> BiFunction<T,T2,R> circuitBreakBiFunction(BiFunction<T,T2,R> biFunction, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker)
      CircuitBreaker BiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      biFunction - a BiFunction<T,T2,R> to be retried
      circuitBreaker - a CircuitBreaker instance
      Returns:
      wrapped biFunction
    • bulkheadBiFunction

      public static <T, T2, R> BiFunction<T,T2,R> bulkheadBiFunction(BiFunction<T,T2,R> biFunction, io.github.resilience4j.bulkhead.Bulkhead bulkhead)
      Bulkhead BiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      biFunction - a BiFunction<T,T2,R> to be retried
      bulkhead - a Bulkhead instance
      Returns:
      wrapped biFunction
    • retryCheckedBiFunction

      public static <T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> retryCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, io.github.resilience4j.retry.Retry retry)
      Retry CheckedBiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      checkedBiFunction - a io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> to be retried
      retry - a Retry instance
      Returns:
      wrapped checkedBiFunction
    • rateLimitCheckedBiFunction

      public static <T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> rateLimitCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter)
      Retry CheckedBiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      checkedBiFunction - a io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> to be retried
      rateLimiter - a RateLimiter instance
      Returns:
      wrapped checkedBiFunction
    • circuitBreakCheckedBiFunction

      public static <T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> circuitBreakCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker)
      Retry CheckedBiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      checkedBiFunction - a io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> to be retried
      circuitBreaker - a CircuitBreaker instance
      Returns:
      wrapped checkedBiFunction
    • bulkheadCheckedBiFunction

      public static <T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> bulkheadCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, io.github.resilience4j.bulkhead.Bulkhead bulkhead)
      Retry CheckedBiFunction wrapper
      Type Parameters:
      T - input type
      T2 - input type
      R - output type
      Parameters:
      checkedBiFunction - a io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> to be retried
      bulkhead - a Bulkhead instance
      Returns:
      wrapped checkedBiFunction
    • errorMappedCheckedFunction

      public static <X extends Exception, X2 extends Exception, X3 extends Exception, T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> errorMappedCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> checkedFunction, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2, Class<X3> ex3, UnaryOperator<Exception> op3)
      An exception mapped CheckedFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      X3 - 3rd type of exception to be mapped
      T - type of input
      R - type of the result
      Parameters:
      checkedFunction - (@link CheckedFunction} to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<Exception> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exceotion
      ex3 - a Class<Exception> encountered by the callable
      op3 - transforming UnaryOperator to transforming the ex to another exceotion
      Returns:
      supplier wrapped
    • errorMappedCheckedFunction

      public static <X extends Exception, X2 extends Exception, T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> errorMappedCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> checkedFunction, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2)
      An exception mapped CheckedFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      T - type of input
      R - type of the result
      Parameters:
      checkedFunction - (@link CheckedFunction} to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<Exception> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exceotion
      Returns:
      supplier wrapped
    • errorMappedCheckedFunction

      public static <X extends Exception, T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> errorMappedCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> checkedFunction, Class<X> ex, UnaryOperator<Exception> op)
      An exception mapped CheckedFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      T - type of input
      R - type of the result
      Parameters:
      checkedFunction - (@link CheckedFunction} to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      Returns:
      supplier wrapped
    • errorMappedFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, X3 extends RuntimeException, T, R> Function<T,R> errorMappedFunction(Function<T,R> function, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2, Class<X3> ex3, UnaryOperator<Exception> op3)
      An exception mapped Function wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      X3 - 3rd type of exception to be mapped
      T - type of input
      R - type of the result
      Parameters:
      function - (@link Function} to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exception
      ex3 - a Class<RuntimeException> encountered by the callable
      op3 - transforming UnaryOperator to transforming the ex to another exception
      Returns:
      function wrapped
    • errorMappedFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, T, R> Function<T,R> errorMappedFunction(Function<T,R> function, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2)
      An exception mapped Function wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      T - type of input
      R - type of the result
      Parameters:
      function - (@link Function} to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exceotion
      Returns:
      function wrapped
    • errorMappedFunction

      public static <X extends RuntimeException, T, R> Function<T,R> errorMappedFunction(Function<T,R> function, Class<X> ex, UnaryOperator<Exception> op)
      An exception mapped Function wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      T - type of input
      R - type of the result
      Parameters:
      function - (@link Function} to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      Returns:
      function wrapped
    • errorMappedCheckedBiFunction

      public static <X extends Exception, X2 extends Exception, X3 extends Exception, T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> errorMappedCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2, Class<X3> ex3, UnaryOperator<Exception> op3)
      An exception mapped CheckedBiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      X3 - 3rd type of exception to be mapped
      T - 1st type of input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      checkedBiFunction - (@link CheckedBiFunction} to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<Exception> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exception
      ex3 - a Class<Exception> encountered by the callable
      op3 - transforming UnaryOperator to transforming the ex to another exception
      Returns:
      checkedBiFunction wrapped
    • errorMappedCheckedBiFunction

      public static <X extends Exception, X2 extends Exception, T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> errorMappedCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2)
      An exception mapped CheckedBiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      T - 1st type of input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      checkedBiFunction - (@link CheckedBiFunction} to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<Exception> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exceotion
      Returns:
      checkedBiFunction wrapped
    • errorMappedCheckedBiFunction

      public static <X extends Exception, T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> errorMappedCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, Class<X> ex, UnaryOperator<Exception> op)
      An exception mapped CheckedBiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      T - 1st type of input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      checkedBiFunction - (@link CheckedBiFunction} to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      Returns:
      checkedBiFunction wrapped
    • errorMappedBiFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, X3 extends RuntimeException, T, T2, R> BiFunction<T,T2,R> errorMappedBiFunction(BiFunction<T,T2,R> biFunction, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2, Class<X3> ex3, UnaryOperator<Exception> op3)
      An exception mapped BiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      X3 - 3rd type of exception to be mapped
      T - 1st type of input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      biFunction - (@link BiFunction} to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exceotion
      ex3 - a Class<RuntimeException> encountered by the callable
      op3 - transforming UnaryOperator to transforming the ex to another exceotion
      Returns:
      biFunction wrapped
    • errorMappedBiFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, T, T2, R> BiFunction<T,T2,R> errorMappedBiFunction(BiFunction<T,T2,R> biFunction, Class<X> ex, UnaryOperator<Exception> op, Class<X2> ex2, UnaryOperator<Exception> op2)
      An exception mapped BiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      X2 - 2nd type of exception to be mapped
      T - 1st type of input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      biFunction - (@link BiFunction} to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - transforming UnaryOperator to transforming the ex to another exceotion
      Returns:
      biFunction wrapped
    • errorMappedBiFunction

      public static <X extends RuntimeException, T, T2, R> BiFunction<T,T2,R> errorMappedBiFunction(BiFunction<T,T2,R> biFunction, Class<X> ex, UnaryOperator<Exception> op)
      An exception mapped BiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be mapped
      T - 1st type of input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      biFunction - (@link BiFunction} to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - transforming UnaryOperator to transforming the ex to another exception
      Returns:
      biFunction wrapped
    • errorConsumedFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, X3 extends RuntimeException, T, R> Function<T,R> errorConsumedFunction(Function<T,R> function, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2, Class<X3> ex3, Consumer<X3> op3)
      An exception consuming function wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      X3 - 3rd type of exception to be consumed
      T - type of the input
      R - type of the result
      Parameters:
      function - to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      ex3 - a Class<RuntimeException> encountered by the callable
      op3 - a Consumer to consume the ex encountered
      Returns:
      function wrapped
    • errorConsumedFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, T, R> Function<T,R> errorConsumedFunction(Function<T,R> function, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2)
      An exception consuming function wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      T - type of the input
      R - type of the result
      Parameters:
      function - to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      Returns:
      function wrapped
    • errorConsumedFunction

      public static <X extends RuntimeException, T, R> Function<T,R> errorConsumedFunction(Function<T,R> function, Class<X> ex, Consumer<X> op)
      An exception consuming function wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      T - type of the input
      R - type of the result
      Parameters:
      function - to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - a Consumer to consume the ex encountered
      Returns:
      function wrapped
    • errorConsumedCheckedFunction

      public static <X extends Exception, X2 extends Exception, X3 extends Exception, T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> errorConsumedCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> function, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2, Class<X3> ex3, Consumer<X3> op3)
      An exception consuming CheckedFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      X3 - 3rd type of exception to be consumed
      T - type of the input
      R - type of the result
      Parameters:
      function - to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<Exception> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      ex3 - a Class<Exception> encountered by the callable
      op3 - a Consumer to consume the ex encountered
      Returns:
      function wrapped
    • errorConsumedCheckedFunction

      public static <X extends Exception, X2 extends Exception, T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> errorConsumedCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> function, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2)
      An exception consuming CheckedFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      T - type of the input
      R - type of the result
      Parameters:
      function - to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<Exception> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      Returns:
      function wrapped
    • errorConsumedCheckedFunction

      public static <X extends Exception, T, R> io.github.resilience4j.core.functions.CheckedFunction<T,R> errorConsumedCheckedFunction(io.github.resilience4j.core.functions.CheckedFunction<T,R> function, Class<X> ex, Consumer<X> op)
      An exception consuming CheckedFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      T - type of the input
      R - type of the result
      Parameters:
      function - to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - a Consumer to consume the ex encountered
      Returns:
      function wrapped
    • errorConsumedBiFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, X3 extends RuntimeException, T, T2, R> BiFunction<T,T2,R> errorConsumedBiFunction(BiFunction<T,T2,R> biFunction, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2, Class<X3> ex3, Consumer<X3> op3)
      An exception consuming BiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      X3 - 3rd type of exception to be consumed
      T - type of the input
      T2 - 2nd type of the input
      R - type of the result
      Parameters:
      biFunction - to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      ex3 - a Class<RuntimeException> encountered by the callable
      op3 - a Consumer to consume the ex encountered
      Returns:
      biFunction wrapped
    • errorConsumedBiFunction

      public static <X extends RuntimeException, X2 extends RuntimeException, T, T2, R> BiFunction<T,T2,R> errorConsumedBiFunction(BiFunction<T,T2,R> biFunction, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2)
      An exception consuming BiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      T - type of the input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      biFunction - to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<RuntimeException> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      Returns:
      biFunction wrapped
    • errorConsumedBiFunction

      public static <X extends RuntimeException, T, T2, R> BiFunction<T,T2,R> errorConsumedBiFunction(BiFunction<T,T2,R> biFunction, Class<X> ex, Consumer<X> op)
      An exception consuming BiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      T - type of the input
      T2 - type of the input
      R - type of the result
      Parameters:
      biFunction - to be wrapped
      ex - a Class<RuntimeException> encountered by the callable
      op - a Consumer to consume the ex encountered
      Returns:
      biFunction wrapped
    • errorConsumedCheckedBiFunction

      public static <X extends Exception, X2 extends Exception, X3 extends Exception, T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> errorConsumedCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2, Class<X3> ex3, Consumer<X3> op3)
      An exception consuming CheckedBiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      X3 - 3rd type of exception to be consumed
      T - type of the input
      T2 - type of 2nd input
      R - type of the result
      Parameters:
      checkedBiFunction - to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<Exception> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      ex3 - a Class<Exception> encountered by the callable
      op3 - a Consumer to consume the ex encountered
      Returns:
      checkedBiFunction wrapped
    • errorConsumedCheckedBiFunction

      public static <X extends Exception, X2 extends Exception, T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> errorConsumedCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, Class<X> ex, Consumer<X> op, Class<X2> ex2, Consumer<X2> op2)
      An exception consuming CheckedFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      T - type of the input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      checkedBiFunction - to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - a Consumer to consume the ex encountered
      ex2 - a Class<Exception> encountered by the callable
      op2 - a Consumer to consume the ex encountered
      Returns:
      function wrapped
    • errorConsumedCheckedBiFunction

      public static <X extends Exception, X2 extends Exception, X3 extends Exception, T, T2, R> io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> errorConsumedCheckedBiFunction(io.github.resilience4j.core.functions.CheckedBiFunction<T,T2,R> checkedBiFunction, Class<X> ex, Consumer<X> op)
      An exception consuming CheckedBiFunction wrapper
      Type Parameters:
      X - Ist type of exception to be consumed
      X2 - 2nd type of exception to be consumed
      X3 - 3rd type of exception to be consumed
      T - type of the input
      T2 - 2nd type of input
      R - type of the result
      Parameters:
      checkedBiFunction - to be wrapped
      ex - a Class<Exception> encountered by the callable
      op - a Consumer to consume the ex encountered
      Returns:
      checkedBiFunction wrapped