/** .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); */ public static <T> Consumer<T> rethrowConsumer(Consumer_WithExceptions<T> consumer) { return t -> { try { consumer.accept(t); } catch (Exception exception) { throwAsUnchecked(exception); } }; }
/** .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); */ public static <T> Consumer<T> rethrowConsumer(Consumer_WithExceptions<T> consumer) { return t -> { try { consumer.accept(t); } catch (Exception exception) { throwAsUnchecked(exception); } }; }
/** .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); */ public static <T> Consumer<T> rethrowConsumer(Consumer_WithExceptions<T> consumer) { return t -> { try { consumer.accept(t); } catch (Exception exception) { throwAsUnchecked(exception); } }; }
/** .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); */ public static <T> Consumer<T> rethrowConsumer(Consumer_WithExceptions<T> consumer) { return t -> { try { consumer.accept(t); } catch (Exception exception) { throwAsUnchecked(exception); } }; }
/** .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); */ public static <T> Consumer<T> rethrowConsumer(Consumer_WithExceptions<T> consumer) { return t -> { try { consumer.accept(t); } catch (Exception exception) { throwAsUnchecked(exception); } }; }
/** .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); */ public static <T> Consumer<T> rethrowConsumer(Consumer_WithExceptions<T> consumer) { return t -> { try { consumer.accept(t); } catch (Exception exception) { throwAsUnchecked(exception); } }; }
/** .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); */ public static <T> Consumer<T> rethrowConsumer(Consumer_WithExceptions<T> consumer) { return t -> { try { consumer.accept(t); } catch (Exception exception) { throwAsUnchecked(exception); } }; }