Interface NoReturnExceptionHandlerSupport<F,S,Z extends NoReturnExceptionHandlerSupport<F,S,Z>>
-
- Type Parameters:
F- the type of the java standard functional interface. For example,Consumer<T>. The same functional interface is also used for the lifted and ignored version.S- the type of a java standard function interface to return aCompletionStage.
- All Superinterfaces:
ExceptionHandlerSupport<F,F,Z>
- All Known Subinterfaces:
BiConsumerWithException<T,U,E>,ConsumerWithException<T,E>,DoubleConsumerWithException<E>,IntConsumerWithException<E>,LongConsumerWithException<E>,ObjDoubleConsumerWithException<T,E>,ObjIntConsumerWithException<T,E>,ObjLongConsumerWithException<T,E>,RunnableWithException<E>
public interface NoReturnExceptionHandlerSupport<F,S,Z extends NoReturnExceptionHandlerSupport<F,S,Z>> extends ExceptionHandlerSupport<F,F,Z>
Root interface to support global operations related to exception handling for functional interface without return value.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Fignore()Converts this functional interface to a lifted one.default Flift()Converts this functional interface to a lifted one.default Consumer<Exception>notThrowingHandler()Used internally to support the exception interception.Sstage()Converts this functional interface to a lifted one, using aCompletionStageas a return value.static CompletionStage<Void>staged(RunnableWithException<?> internal)Used internally to support the exception interception.default Consumer<Exception>throwingHandler()Used internally to support the exception interception.Funcheck()Converts this functional interface to the corresponding one in java and wrap exception usingExceptionHandlerSupport.exceptionMapper().static voidunchecked(RunnableWithException<?> internal, Consumer<Exception> exceptionhandler)Used internally to support the exception interception.-
Methods inherited from interface ch.powerunit.extensions.exceptions.ExceptionHandlerSupport
documented, exceptionMapper
-
-
-
-
Method Detail
-
uncheck
F uncheck()
Converts this functional interface to the corresponding one in java and wrap exception usingExceptionHandlerSupport.exceptionMapper().Conceptually, the exception encapsulation is done in the following way :
(xxx) -> { try { // do the underlying functional interface action and return result if // applicable } catch (Exception e) { throw new exceptionMapper().apply(e); } }
-
lift
default F lift()
Converts this functional interface to a lifted one.The concept is :
(xxx) -> { try { realaction(xxx); } catch (Exception e) { // do nothing } }
-
ignore
F ignore()
Converts this functional interface to a lifted one.The concept is :
(xxx) -> { try { realaction(xxx); } catch (Exception e) { // do nothing } }
-
stage
S stage()
Converts this functional interface to a lifted one, using aCompletionStageas a return value.- Returns:
- the lifted function
- Since:
- 1.1.0
-
unchecked
static void unchecked(RunnableWithException<?> internal, Consumer<Exception> exceptionhandler)
Used internally to support the exception interception.- Parameters:
internal- the call to be doneexceptionhandler- the exception handler. May throw RuntimeException..- Throws:
RuntimeException- in case of error
-
staged
static CompletionStage<Void> staged(RunnableWithException<?> internal)
Used internally to support the exception interception.- Parameters:
internal- the call to be done- Returns:
- the completion stage
- Throws:
RuntimeException- in case of error
-
throwingHandler
default Consumer<Exception> throwingHandler()
Used internally to support the exception interception.- Returns:
- exception handler to support exception control
-
notThrowingHandler
default Consumer<Exception> notThrowingHandler()
Used internally to support the exception interception.- Returns:
- exception handler to ignore exception control
-
-