Package com.atlassian.confluence.util
Class ConnectableConsumer<T>
- java.lang.Object
-
- com.atlassian.confluence.util.ConnectableConsumer<T>
-
- Type Parameters:
T
- the type of the input
- All Implemented Interfaces:
Consumer<T>
@ParametersAreNonnullByDefault public class ConnectableConsumer<T> extends Object implements Consumer<T>
A proxyConsumer
that collects the items itaccepts
, then pass them through to a targetConsumer
whenconnected
. In this way, you can startaccepting
items before the targetConsumer
is available.- Since:
- 7.11
-
-
Constructor Summary
Constructors Constructor Description ConnectableConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(T t)
void
connect(Consumer<T> consumer)
Process all buffered items, and send all future items to the targetConsumer
-