@Mutable
@Functional
public interface FailableConsumer<INPUT,EXCEPTION extends Exception>
INPUT without returning a result.| Modifier and Type | Method and Description |
|---|---|
default <SUBTYPE extends INPUT> |
after(@Nonnull FailableConsumer<? super SUBTYPE,? extends EXCEPTION> consumer)
Returns the composition of the given consumer followed by this consumer.
|
default <INITIAL_INPUT> |
after(@Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
Returns the composition of the given function followed by this consumer.
|
default @Nonnull FailableUnaryFunction<INPUT,Void,EXCEPTION> |
asFunction()
Returns this consumer as a unary function that always returns null.
|
default <SUBTYPE extends INPUT> |
before(@Nonnull FailableConsumer<? super SUBTYPE,? extends EXCEPTION> consumer)
Returns the composition of this consumer followed by the given consumer.
|
static <INPUT,EXCEPTION extends Exception> |
compose(@Nonnull FailableConsumer<? super INPUT,? extends EXCEPTION> consumer0,
@Nonnull FailableConsumer<? super INPUT,? extends EXCEPTION> consumer1)
Returns the composition of the given consumers with a flexible exception type.
|
void |
consume(INPUT input)
Consumes the given input.
|
default @Nonnull Consumer<INPUT> |
suppressExceptions()
Returns a consumer that suppresses the exceptions of this consumer.
|
default @Nonnull Consumer<INPUT> |
suppressExceptions(@Nonnull Consumer<? super Exception> handler)
Returns a consumer that suppresses the exceptions of this consumer and passes them to the given exception handler instead.
|
default @Nonnull FailableConsumer<INPUT,EXCEPTION> |
synchronize()
Returns a consumer that synchronizes on this consumer.
|
@Impure
void consume(@Captured
INPUT input)
throws EXCEPTION extends Exception
@Pure @Capturable @Nonnull default @Nonnull Consumer<INPUT> suppressExceptions(@Captured @Nonnull @Nonnull Consumer<? super Exception> handler)
@Pure @Capturable @Nonnull default @Nonnull Consumer<INPUT> suppressExceptions()
@Pure @Capturable @Nonnull static <INPUT,EXCEPTION extends Exception> @Nonnull FailableConsumer<INPUT,EXCEPTION> compose(@Captured @Nonnull @Nonnull FailableConsumer<? super INPUT,? extends EXCEPTION> consumer0, @Captured @Nonnull @Nonnull FailableConsumer<? super INPUT,? extends EXCEPTION> consumer1)
@Pure @Capturable @Nonnull default <SUBTYPE extends INPUT> @Nonnull FailableConsumer<SUBTYPE,EXCEPTION> before(@Captured @Nonnull @Nonnull FailableConsumer<? super SUBTYPE,? extends EXCEPTION> consumer)
@Pure @Capturable @Nonnull default <SUBTYPE extends INPUT> @Nonnull FailableConsumer<SUBTYPE,EXCEPTION> after(@Captured @Nonnull @Nonnull FailableConsumer<? super SUBTYPE,? extends EXCEPTION> consumer)
@Pure @Capturable @Nonnull default <INITIAL_INPUT> @Nonnull FailableConsumer<INITIAL_INPUT,EXCEPTION> after(@Nonnull @Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
@Pure @Nonnull default @Nonnull FailableUnaryFunction<INPUT,Void,EXCEPTION> asFunction()
@Pure @Nonnull default @Nonnull FailableConsumer<INPUT,EXCEPTION> synchronize()
Copyright © 2017. All rights reserved.