Uses of Interface
org.apache.juneau.commons.function.ThrowingSupplier
Packages that use ThrowingSupplier
-
Uses of ThrowingSupplier in org.apache.juneau.commons.utils
Methods in org.apache.juneau.commons.utils with parameters of type ThrowingSupplierModifier and TypeMethodDescriptionstatic <T> TUtils.safe(ThrowingSupplier<T> s) Used to wrap code that returns a value but throws an exception.static <T> TUtils.safe(ThrowingSupplier<T> s, Function<Exception, RuntimeException> exceptionMapper) Used to wrap code that returns a value but throws an exception, with a custom exception mapper.static <T> TUtils.safeCatch(ThrowingSupplier<T> s, Function<Throwable, T> exceptionFunction) Executes a supplier that may throw an exception and returns the result or a fallback value.static <T> Optional<T>Utils.safeOpt(ThrowingSupplier<T> s) Executes a supplier that may throw an exception and returns an Optional.static <T> Optional<T>Utils.safeOptCatch(ThrowingSupplier<T> s, Function<Throwable, T> exceptionFunction) Executes a supplier that may throw an exception and returns an Optional with the result or a fallback value.static <T> TUtils.safeOrNull(ThrowingSupplier<T> s) Executes a supplier that may throw an exception and returns the result ornull .