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. |
size
T consume() throws NoSuchElementException
null
otherwise{@link
- ClosedConsumerException} if the consumer is already closedNoSuchElementException
boolean 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–2016 MuleSoft, Inc.. All rights reserved.