E - the type of the potential exception of the operationExceptionHandlerSupport<F,F>, NoReturnExceptionHandlerSupport<IntConsumer,IntFunction<CompletionStage<Void>>>@FunctionalInterface public interface IntConsumerWithException<E extends Exception> extends NoReturnExceptionHandlerSupport<IntConsumer,IntFunction<CompletionStage<Void>>>
int-valued argument,
may throw exception and returns no result. This is the primitive type
specialization of ConsumerWithException for int. Unlike most
other functional interfaces, IntConsumerWithException is expected to
operate via side-effects.
void accept(int value) throws
E - The functional method.IntConsumerIntConsumerIntConsumerIntConsumer| Modifier and Type | Method | Description |
|---|---|---|
void |
accept(int value) |
Performs this operation on the given argument.
|
default IntConsumerWithException<E> |
andThen(IntConsumerWithException<? extends E> after) |
Returns a composed
IntConsumerWithException that performs, in
sequence, this operation followed by the after operation. |
static <E extends Exception> |
asConsumer(IntConsumerWithException<E> operation) |
Converts a
IntConsumerWithException to a
ConsumerWithException. |
static <E extends Exception> |
failing(Supplier<E> exceptionBuilder) |
Returns an operation that always throw exception.
|
default IntConsumer |
ignore() |
Converts this
IntConsumerWithException to a lifted
IntConsumer ignoring exception. |
static <E extends Exception> |
ignored(IntConsumerWithException<E> operation) |
Converts a
IntConsumerWithException to a lifted IntConsumer
ignoring exception. |
static <E extends Exception> |
lifted(IntConsumerWithException<E> operation) |
Converts a
IntConsumerWithException to a lifted IntConsumer
ignoring exception. |
default IntFunction<CompletionStage<Void>> |
stage() |
Converts this
IntConsumerWithException to a staged
IntFunction that return a CompletionStage. |
static <E extends Exception> |
staged(IntConsumerWithException<E> operation) |
Converts a
IntConsumerWithException to a staged IntFunction . |
default IntConsumer |
uncheck() |
Converts this
IntConsumerWithException to a IntConsumer that
wraps exception to RuntimeException. |
static <E extends Exception> |
unchecked(IntConsumerWithException<E> operation) |
Converts a
IntConsumerWithException to a IntConsumer that
wraps exception to RuntimeException. |
static <E extends Exception> |
unchecked(IntConsumerWithException<E> operation,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
IntConsumerWithException to a IntConsumer that
wraps exception to RuntimeException by using the provided mapping
function. |
exceptionMapper, exceptionMapperForlift, notThrowingHandler, staged, throwingHandler, uncheckedvoid accept(int value)
throws E extends Exception
value - the input argumentE - any exceptionE extends ExceptionIntConsumer.accept(int)default IntConsumer uncheck()
IntConsumerWithException to a IntConsumer that
wraps exception to RuntimeException.uncheck in interface ExceptionHandlerSupport<F,F>uncheck in interface NoReturnExceptionHandlerSupport<IntConsumer,IntFunction<CompletionStage<Void>>>unchecked(IntConsumerWithException),
unchecked(IntConsumerWithException, Function)default IntConsumer ignore()
IntConsumerWithException to a lifted
IntConsumer ignoring exception.ignore in interface ExceptionHandlerSupport<F,F>ignore in interface NoReturnExceptionHandlerSupport<IntConsumer,IntFunction<CompletionStage<Void>>>ignored(IntConsumerWithException)default IntFunction<CompletionStage<Void>> stage()
IntConsumerWithException to a staged
IntFunction that return a CompletionStage.stage in interface NoReturnExceptionHandlerSupport<IntConsumer,IntFunction<CompletionStage<Void>>>default IntConsumerWithException<E> andThen(IntConsumerWithException<? extends E> after)
IntConsumerWithException that performs, in
sequence, this operation followed by the after operation. If
performing either operation throws an exception, it is relayed to the caller
of the composed operation. If performing this operation throws an exception,
the after operation will not be performed.after - the operation to perform after this operationIntConsumer that performs in sequence this
operation followed by the after operationNullPointerException - if after is nullIntConsumer.andThen(IntConsumer)static <E extends Exception> IntConsumerWithException<E> failing(Supplier<E> exceptionBuilder)
E - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <E extends Exception> IntConsumer unchecked(IntConsumerWithException<E> operation)
IntConsumerWithException to a IntConsumer that
wraps exception to RuntimeException.E - the type of the potential exceptionoperation - to be uncheckedNullPointerException - if operation is nulluncheck(),
unchecked(IntConsumerWithException, Function)static <E extends Exception> IntConsumer unchecked(IntConsumerWithException<E> operation, Function<Exception,RuntimeException> exceptionMapper)
IntConsumerWithException to a IntConsumer that
wraps exception to RuntimeException by using the provided mapping
function.E - the type of the potential exceptionoperation - the be uncheckedexceptionMapper - a function to convert the exception to the runtime exception.NullPointerException - if operation or exceptionMapper is nulluncheck(),
unchecked(IntConsumerWithException)static <E extends Exception> IntConsumer lifted(IntConsumerWithException<E> operation)
IntConsumerWithException to a lifted IntConsumer
ignoring exception.E - the type of the potential exceptionoperation - to be liftedNoReturnExceptionHandlerSupport.lift()static <E extends Exception> IntConsumer ignored(IntConsumerWithException<E> operation)
IntConsumerWithException to a lifted IntConsumer
ignoring exception.E - the type of the potential exceptionoperation - to be liftedNullPointerException - if operation is nullignore()static <E extends Exception> IntFunction<CompletionStage<Void>> staged(IntConsumerWithException<E> operation)
IntConsumerWithException to a staged IntFunction .E - the type of the potential exceptionoperation - to be stagedNullPointerException - if operation is nullstatic <E extends Exception> ConsumerWithException<Integer,E> asConsumer(IntConsumerWithException<E> operation)
IntConsumerWithException to a
ConsumerWithException.E - the type of the potential exceptionoperation - to be convertedNullPointerException - if operation is nullCopyright © 2019. All rights reserved.