Package fr.enedis.chutney.tools
Class Try<T>
java.lang.Object
fr.enedis.chutney.tools.Try<T>
-
Method Summary
Modifier and TypeMethodDescriptionexec(ThrowingSupplier<T, E> builder) get()getError()runtime()tryToRecover(ThrowingFunction<? super Exception, T, ? extends Exception> recoverFunction) tryToRecover(Class<Handled> handledClass, ThrowingFunction<? super Exception, T, ? extends Exception> recoverFunction) static <T,E extends Exception>
Tunsafe(ThrowingSupplier<T, E> block) static <T,E extends Exception>
Tunsafe(String message, ThrowingSupplier<T, E> block)
-
Method Details
-
unsafe
-
unsafe
-
exec
-
runtime
-
get
- Throws:
IllegalStateException
-
getError
- Throws:
IllegalStateException
-
ifFailed
-
tryToRecover
-
tryToRecover
-
ifSuccess
-