Interface ObjDoubleConsumerWithException<T,E extends Exception>
-
- Type Parameters:
T- the type of the object argument to the operationE- the type of the potential exception of the operation
- All Superinterfaces:
ExceptionHandlerSupport<ObjDoubleConsumer<T>,ObjDoubleConsumer<T>,ObjDoubleConsumerWithException<T,E>>,NoReturnExceptionHandlerSupport<ObjDoubleConsumer<T>,BiFunction<T,Double,CompletionStage<Void>>,ObjDoubleConsumerWithException<T,E>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ObjDoubleConsumerWithException<T,E extends Exception> extends NoReturnExceptionHandlerSupport<ObjDoubleConsumer<T>,BiFunction<T,Double,CompletionStage<Void>>,ObjDoubleConsumerWithException<T,E>>
Represents an operation that accepts an object-valued and adouble-valued argument, and returns no result. This is the(reference, double)specialization ofBiConsumerWithException. Unlike most other functional interfaces,ObjDoubleConsumerWithExceptionis expected to operate via side-effects.General contract
void accept(T t, double value) throws E- The functional method.- uncheck - Return a
ObjDoubleConsumer<T> - lift - Return a
ObjDoubleConsumer<T> - ignore - Return a
ObjDoubleConsumer<T>
- See Also:
ObjDoubleConsumer
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaccept(T t, double value)Performs this operation on the given arguments.static <T,E extends Exception>
BiConsumerWithException<T,Double,E>asBiConsumer(ObjDoubleConsumerWithException<T,E> operation)Converts aObjDoubleConsumerWithExceptionto aBiConsumerWithExceptionreturningnull.static <T,E extends Exception>
ObjDoubleConsumerWithException<T,E>failing(Supplier<E> exceptionBuilder)Returns an operation that always throw exception.default ObjDoubleConsumer<T>ignore()Converts thisObjLongConsumerWithExceptionto a liftedObjDoubleConsumerignoring exception.static <T,E extends Exception>
ObjDoubleConsumer<T>ignored(ObjDoubleConsumerWithException<T,E> operation)Converts aObjLongConsumerWithExceptionto a liftedObjDoubleConsumerignoring exception.static <T,E extends Exception>
ObjDoubleConsumer<T>lifted(ObjDoubleConsumerWithException<T,E> operation)Converts aObjLongConsumerWithExceptionto a liftedObjDoubleConsumerignoring exception.default BiFunction<T,Double,CompletionStage<Void>>stage()Converts thisObjDoubleConsumerWithExceptionto a stagedBiFunctionthat return aCompletionStage.static <T,E extends Exception>
BiFunction<T,Double,CompletionStage<Void>>staged(ObjDoubleConsumerWithException<T,E> operation)Converts aObjDoubleConsumerWithExceptionto a stagedBiFunction.default ObjDoubleConsumer<T>uncheck()Converts thisObjLongConsumerWithExceptionto aObjDoubleConsumerthat wraps exception toRuntimeException.static <T,E extends Exception>
ObjDoubleConsumer<T>unchecked(ObjDoubleConsumerWithException<T,E> operation)Converts aObjDoubleConsumerWithExceptionto aObjDoubleConsumerthat wraps exception toRuntimeException.static <T,E extends Exception>
ObjDoubleConsumer<T>unchecked(ObjDoubleConsumerWithException<T,E> operation, Function<Exception,RuntimeException> exceptionMapper)Converts aObjLongConsumerWithExceptionto aObjDoubleConsumerthat wraps exception toRuntimeExceptionby using the provided mapping function.-
Methods inherited from interface ch.powerunit.extensions.exceptions.ExceptionHandlerSupport
documented, exceptionMapper
-
Methods inherited from interface ch.powerunit.extensions.exceptions.NoReturnExceptionHandlerSupport
lift, notThrowingHandler, throwingHandler
-
-
-
-
Method Detail
-
accept
void accept(T t, double value) throws E extends Exception
Performs this operation on the given arguments.- Parameters:
t- the first input argumentvalue- the second input argument- Throws:
E- any exceptionE extends Exception- See Also:
ObjDoubleConsumer.accept(Object,double)
-
uncheck
default ObjDoubleConsumer<T> uncheck()
Converts thisObjLongConsumerWithExceptionto aObjDoubleConsumerthat wraps exception toRuntimeException.- Specified by:
uncheckin interfaceExceptionHandlerSupport<ObjDoubleConsumer<T>,ObjDoubleConsumer<T>,ObjDoubleConsumerWithException<T,E extends Exception>>- Specified by:
uncheckin interfaceNoReturnExceptionHandlerSupport<ObjDoubleConsumer<T>,BiFunction<T,Double,CompletionStage<Void>>,ObjDoubleConsumerWithException<T,E extends Exception>>- Returns:
- the unchecked operation
- See Also:
unchecked(ObjDoubleConsumerWithException),unchecked(ObjDoubleConsumerWithException, Function)
-
ignore
default ObjDoubleConsumer<T> ignore()
Converts thisObjLongConsumerWithExceptionto a liftedObjDoubleConsumerignoring exception.- Specified by:
ignorein interfaceExceptionHandlerSupport<ObjDoubleConsumer<T>,ObjDoubleConsumer<T>,ObjDoubleConsumerWithException<T,E extends Exception>>- Specified by:
ignorein interfaceNoReturnExceptionHandlerSupport<ObjDoubleConsumer<T>,BiFunction<T,Double,CompletionStage<Void>>,ObjDoubleConsumerWithException<T,E extends Exception>>- Returns:
- the operation that ignore error
- See Also:
ignored(ObjDoubleConsumerWithException)
-
stage
default BiFunction<T,Double,CompletionStage<Void>> stage()
Converts thisObjDoubleConsumerWithExceptionto a stagedBiFunctionthat return aCompletionStage.- Specified by:
stagein interfaceNoReturnExceptionHandlerSupport<ObjDoubleConsumer<T>,BiFunction<T,Double,CompletionStage<Void>>,ObjDoubleConsumerWithException<T,E extends Exception>>- Returns:
- the staged operation.
- Since:
- 1.1.0
-
failing
static <T,E extends Exception> ObjDoubleConsumerWithException<T,E> failing(Supplier<E> exceptionBuilder)
Returns an operation that always throw exception.- Type Parameters:
T- the type of the object argument to the operationE- the type of the exception- Parameters:
exceptionBuilder- the supplier to create the exception- Returns:
- an operation that always throw exception
-
unchecked
static <T,E extends Exception> ObjDoubleConsumer<T> unchecked(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjDoubleConsumerWithExceptionto aObjDoubleConsumerthat wraps exception toRuntimeException.- Type Parameters:
T- the type of the object argument to the operationE- the type of the potential exception- Parameters:
operation- to be unchecked- Returns:
- the unchecked operation
- Throws:
NullPointerException- if operation is null- See Also:
uncheck(),unchecked(ObjDoubleConsumerWithException, Function)
-
unchecked
static <T,E extends Exception> ObjDoubleConsumer<T> unchecked(ObjDoubleConsumerWithException<T,E> operation, Function<Exception,RuntimeException> exceptionMapper)
Converts aObjLongConsumerWithExceptionto aObjDoubleConsumerthat wraps exception toRuntimeExceptionby using the provided mapping function.- Type Parameters:
T- the type of the object argument to the operationE- the type of the potential exception- Parameters:
operation- the be uncheckedexceptionMapper- a function to convert the exception to the runtime exception.- Returns:
- the unchecked operation
- Throws:
NullPointerException- if operation or exceptionMapper is null- See Also:
uncheck(),unchecked(ObjDoubleConsumerWithException)
-
lifted
static <T,E extends Exception> ObjDoubleConsumer<T> lifted(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjLongConsumerWithExceptionto a liftedObjDoubleConsumerignoring exception.- Type Parameters:
T- the type of the object argument to the operationE- the type of the potential exception- Parameters:
operation- to be lifted- Returns:
- the lifted operation
- Throws:
NullPointerException- if operation is null- See Also:
NoReturnExceptionHandlerSupport.lift()
-
ignored
static <T,E extends Exception> ObjDoubleConsumer<T> ignored(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjLongConsumerWithExceptionto a liftedObjDoubleConsumerignoring exception.- Type Parameters:
T- the type of the object argument to the operationE- the type of the potential exception- Parameters:
operation- to be lifted- Returns:
- the lifted operation
- Throws:
NullPointerException- if operation is null- See Also:
ignore()
-
staged
static <T,E extends Exception> BiFunction<T,Double,CompletionStage<Void>> staged(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjDoubleConsumerWithExceptionto a stagedBiFunction.- Type Parameters:
T- the type of the object argument to the operationE- the type of the potential exception- Parameters:
operation- to be staged- Returns:
- the staged operation
- Throws:
NullPointerException- if operation is null
-
asBiConsumer
static <T,E extends Exception> BiConsumerWithException<T,Double,E> asBiConsumer(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjDoubleConsumerWithExceptionto aBiConsumerWithExceptionreturningnull.- Type Parameters:
T- the type of the object argument to the operationE- the type of the potential exception- Parameters:
operation- to be lifted- Returns:
- the function
- Throws:
NullPointerException- if operation is null- Since:
- 1.1.0
-
-