Top Description Methods
java.util.function

public Interface IntConsumer

Known Direct Subinterfaces
java.util.stream.IntStream.Builder, java.util.stream.Sink.OfInt
Known Direct Implementers
java.util.stream.SpinedBuffer.OfInt, java.util.stream.StreamSpliterators.UnorderedSliceSpliterator.OfInt, java.util.stream.StreamSpliterators.ArrayBuffer.OfInt, java.util.stream.WhileOps.UnorderedWhileSpliterator.OfInt, java.util.IntSummaryStatistics, java.util.LongSummaryStatistics, java.util.Spliterators.AbstractIntSpliterator.HoldingIntConsumer
Annotations
@FunctionalInterface
Imports
java.util.Objects

Represents an operation that accepts a single int-valued argument and returns no result. This is the primitive type specialization of Consumer for int. Unlike most other functional interfaces, IntConsumer is expected to operate via side-effects.

This is a functional interface whose functional method is accept(int).

Since
1.8
See Also
Consumer

Method Summary

Modifier and TypeMethod and Description
public void
accept(int
the input argument
value
)

Performs this operation on the given argument.

public default IntConsumer

Returns:

a composed IntConsumer that performs in sequence this operation followed by the after operation
andThen
(IntConsumer
the operation to perform after this operation
after
)

Returns a composed IntConsumer that performs, in sequence, this operation followed by the after operation.

Method Detail

acceptback to summary
public void accept(int value)

Performs this operation on the given argument.

Parameters
value:int

the input argument

andThenback to summary
public default IntConsumer andThen(IntConsumer after)

Returns a composed IntConsumer 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.

Parameters
after:IntConsumer

the operation to perform after this operation

Returns:IntConsumer

a composed IntConsumer that performs in sequence this operation followed by the after operation

Exceptions
NullPointerException:
if after is null