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,ObjDoubleConsumerWithException
is 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 void
accept(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 aObjDoubleConsumerWithException
to aBiConsumerWithException
returningnull
.static <T,E extends Exception>
ObjDoubleConsumerWithException<T,E>failing(Supplier<E> exceptionBuilder)
Returns an operation that always throw exception.default ObjDoubleConsumer<T>
ignore()
Converts thisObjLongConsumerWithException
to a liftedObjDoubleConsumer
ignoring exception.static <T,E extends Exception>
ObjDoubleConsumer<T>ignored(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjLongConsumerWithException
to a liftedObjDoubleConsumer
ignoring exception.static <T,E extends Exception>
ObjDoubleConsumer<T>lifted(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjLongConsumerWithException
to a liftedObjDoubleConsumer
ignoring exception.default BiFunction<T,Double,CompletionStage<Void>>
stage()
Converts thisObjDoubleConsumerWithException
to a stagedBiFunction
that return aCompletionStage
.static <T,E extends Exception>
BiFunction<T,Double,CompletionStage<Void>>staged(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjDoubleConsumerWithException
to a stagedBiFunction
.default ObjDoubleConsumer<T>
uncheck()
Converts thisObjLongConsumerWithException
to aObjDoubleConsumer
that wraps exception toRuntimeException
.static <T,E extends Exception>
ObjDoubleConsumer<T>unchecked(ObjDoubleConsumerWithException<T,E> operation)
Converts aObjDoubleConsumerWithException
to aObjDoubleConsumer
that wraps exception toRuntimeException
.static <T,E extends Exception>
ObjDoubleConsumer<T>unchecked(ObjDoubleConsumerWithException<T,E> operation, Function<Exception,RuntimeException> exceptionMapper)
Converts aObjLongConsumerWithException
to aObjDoubleConsumer
that wraps exception toRuntimeException
by 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 thisObjLongConsumerWithException
to aObjDoubleConsumer
that wraps exception toRuntimeException
.- Specified by:
uncheck
in interfaceExceptionHandlerSupport<ObjDoubleConsumer<T>,ObjDoubleConsumer<T>,ObjDoubleConsumerWithException<T,E extends Exception>>
- Specified by:
uncheck
in 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 thisObjLongConsumerWithException
to a liftedObjDoubleConsumer
ignoring exception.- Specified by:
ignore
in interfaceExceptionHandlerSupport<ObjDoubleConsumer<T>,ObjDoubleConsumer<T>,ObjDoubleConsumerWithException<T,E extends Exception>>
- Specified by:
ignore
in 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 thisObjDoubleConsumerWithException
to a stagedBiFunction
that return aCompletionStage
.- Specified by:
stage
in 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 aObjDoubleConsumerWithException
to aObjDoubleConsumer
that 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 aObjLongConsumerWithException
to aObjDoubleConsumer
that wraps exception toRuntimeException
by 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 aObjLongConsumerWithException
to a liftedObjDoubleConsumer
ignoring 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 aObjLongConsumerWithException
to a liftedObjDoubleConsumer
ignoring 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 aObjDoubleConsumerWithException
to 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 aObjDoubleConsumerWithException
to aBiConsumerWithException
returningnull
.- 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
-
-