Class LamdbaExceptionUtils
java.lang.Object
io.github.vampirestudios.vampirelib.utils.LamdbaExceptionUtils
From stackoverflow: https://stackoverflow.com/a/27644392
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic interfacestatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,U, E extends Exception>
BiConsumer<T,U> rethrowBiConsumer(LamdbaExceptionUtils.BiConsumer_WithExceptions<T, U, E> biConsumer) rethrowConsumer(LamdbaExceptionUtils.Consumer_WithExceptions<T, E> consumer) .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println));rethrowFunction(LamdbaExceptionUtils.Function_WithExceptions<T, R, E> function) .map(rethrowFunction(name -> Class.forName(name))) or .map(rethrowFunction(Class::forName))rethrowSupplier(LamdbaExceptionUtils.Supplier_WithExceptions<T, E> function) rethrowSupplier(() -> new StringJoiner(new String(new byte[]{77, 97, 114, 107}, "UTF-8"))),static <T,R, E extends Exception>
Runcheck(LamdbaExceptionUtils.Function_WithExceptions<T, R, E> function, T t) uncheck(Class::forName, "xxx");static voiduncheck(() -> Class.forName("xxx"));static <R,E extends Exception>
Runcheck(LamdbaExceptionUtils.Supplier_WithExceptions<R, E> supplier) uncheck(() -> Class.forName("xxx"));
-
Constructor Details
-
LamdbaExceptionUtils
public LamdbaExceptionUtils()
-
-
Method Details
-
rethrowConsumer
public static <T,E extends Exception> Consumer<T> rethrowConsumer(LamdbaExceptionUtils.Consumer_WithExceptions<T, E> consumer) .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println)); -
rethrowBiConsumer
public static <T,U, BiConsumer<T,E extends Exception> U> rethrowBiConsumer(LamdbaExceptionUtils.BiConsumer_WithExceptions<T, U, E> biConsumer) -
rethrowFunction
public static <T,R, Function<T,E extends Exception> R> rethrowFunction(LamdbaExceptionUtils.Function_WithExceptions<T, R, E> function) .map(rethrowFunction(name -> Class.forName(name))) or .map(rethrowFunction(Class::forName)) -
rethrowSupplier
public static <T,E extends Exception> Supplier<T> rethrowSupplier(LamdbaExceptionUtils.Supplier_WithExceptions<T, E> function) rethrowSupplier(() -> new StringJoiner(new String(new byte[]{77, 97, 114, 107}, "UTF-8"))), -
uncheck
uncheck(() -> Class.forName("xxx")); -
uncheck
public static <R,E extends Exception> R uncheck(LamdbaExceptionUtils.Supplier_WithExceptions<R, E> supplier) uncheck(() -> Class.forName("xxx")); -
uncheck
public static <T,R, R uncheckE extends Exception> (LamdbaExceptionUtils.Function_WithExceptions<T, R, E> function, T t) uncheck(Class::forName, "xxx");
-