Class UncheckConsumer

java.lang.Object
io.hotmoka.exceptions.UncheckConsumer

public abstract class UncheckConsumer extends Object
This class provides a method to transform a consumer with exceptions into a consumer, by unchecking its exceptions.
  • Method Details

    • uncheck

      public static <T> Consumer<T> uncheck(ConsumerWithExceptions<? super T> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      Parameters:
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions
    • uncheck

      public static <T, E extends Throwable> Consumer<T> uncheck(Class<E> exception, ConsumerWithExceptions1<? super T,E> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      E - the type of exceptions that get unchecked
      Parameters:
      exception - the exception tag of E
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions
    • uncheck

      public static <T, E1 extends Throwable, E2 extends Throwable> Consumer<T> uncheck(Class<E1> exception1, Class<E2> exception2, ConsumerWithExceptions2<? super T,E1,E2> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      E1 - the first type of exceptions that get unchecked
      E2 - the second type of exceptions that get unchecked
      Parameters:
      exception1 - the exception tag of E1
      exception2 - the exception tag of E2
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions
    • uncheck

      public static <T, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable> Consumer<T> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, ConsumerWithExceptions3<? super T,E1,E2,E3> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      E1 - the first type of exceptions that get unchecked
      E2 - the second type of exceptions that get unchecked
      E3 - the third type of exceptions that get unchecked
      Parameters:
      exception1 - the exception tag of E1
      exception2 - the exception tag of E2
      exception3 - the exception tag of E3
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions
    • uncheck

      public static <T, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable> Consumer<T> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, ConsumerWithExceptions4<? super T,E1,E2,E3,E4> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      E1 - the first type of exceptions that get unchecked
      E2 - the second type of exceptions that get unchecked
      E3 - the third type of exceptions that get unchecked
      E4 - the fourth type of exceptions that get unchecked
      Parameters:
      exception1 - the exception tag of E1
      exception2 - the exception tag of E2
      exception3 - the exception tag of E3
      exception4 - the exception tag of E4
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions
    • uncheck

      public static <T, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable> Consumer<T> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, ConsumerWithExceptions5<? super T,E1,E2,E3,E4,E5> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      E1 - the first type of exceptions that get unchecked
      E2 - the second type of exceptions that get unchecked
      E3 - the third type of exceptions that get unchecked
      E4 - the fourth type of exceptions that get unchecked
      E5 - the fifth type of exceptions that get unchecked
      Parameters:
      exception1 - the exception tag of E1
      exception2 - the exception tag of E2
      exception3 - the exception tag of E3
      exception4 - the exception tag of E4
      exception5 - the exception tag of E5
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions
    • uncheck

      public static <T, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable> Consumer<T> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, Class<E6> exception6, ConsumerWithExceptions6<? super T,E1,E2,E3,E4,E5,E6> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      E1 - the first type of exceptions that get unchecked
      E2 - the second type of exceptions that get unchecked
      E3 - the third type of exceptions that get unchecked
      E4 - the fourth type of exceptions that get unchecked
      E5 - the fifth type of exceptions that get unchecked
      E6 - the sixth type of exceptions that get unchecked
      Parameters:
      exception1 - the exception tag of E1
      exception2 - the exception tag of E2
      exception3 - the exception tag of E3
      exception4 - the exception tag of E4
      exception5 - the exception tag of E5
      exception6 - the exception tag of E6
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions
    • uncheck

      public static <T, E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable, E7 extends Throwable> Consumer<T> uncheck(Class<E1> exception1, Class<E2> exception2, Class<E3> exception3, Class<E4> exception4, Class<E5> exception5, Class<E6> exception6, Class<E7> exception7, ConsumerWithExceptions7<? super T,E1,E2,E3,E4,E5,E6,E7> wrapped)
      Transforms a consumer with exceptions into a consumer without checked exceptions. This means that all checked exceptions get wrapped into a UncheckedException. They can later be recovered through a method from CheckRunnable or CheckSupplier.
      Type Parameters:
      T - the type of the consumed value
      E1 - the first type of exceptions that get unchecked
      E2 - the second type of exceptions that get unchecked
      E3 - the third type of exceptions that get unchecked
      E4 - the fourth type of exceptions that get unchecked
      E5 - the fifth type of exceptions that get unchecked
      E6 - the sixth type of exceptions that get unchecked
      E7 - the seventh type of exceptions that get unchecked
      Parameters:
      exception1 - the exception tag of E1
      exception2 - the exception tag of E2
      exception3 - the exception tag of E3
      exception4 - the exception tag of E4
      exception5 - the exception tag of E5
      exception6 - the exception tag of E6
      exception7 - the exception tag of E7
      wrapped - the consumer with exceptions
      Returns:
      the consumer without exceptions