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 proxyConsumerthat collects the items itaccepts, then pass them through to a targetConsumerwhenconnected. In this way, you can startacceptingitems before the targetConsumeris available.- Since:
- 7.11
-
-
Constructor Summary
Constructors Constructor Description ConnectableConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(T t)voidconnect(Consumer<T> consumer)Process all buffered items, and send all future items to the targetConsumer
-