public interface Consumer<T> extends Closeable, ProvidesTotalHint
| Modifier and Type | Method and Description |
|---|---|
T |
consume()
Retrieves the next available item.
|
boolean |
isConsumed()
Returns
true if no more items are available or if the consumer
was closed. |
sizeT consume() throws NoSuchElementException
null otherwise{@link - ClosedConsumerException} if the consumer is already closedNoSuchElementExceptionboolean isConsumed()
true if no more items are available or if the consumer
was closed. When this method returns true, implementors of this
class are require to invoke the Closeable.close() method before
returning in order to release resources as quickly as possible. Users of this
component who no longer need this require before it is fully consumed are also
required to close it.true if no more items are available. false
otherwiseCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.