public class ListConsumer<T> extends AbstractConsumer<T,List<T>>
Consumer that obtains a List from a Producer and returns the elements one by one.
This implementation is not thread-safe.producer| Constructor and Description |
|---|
ListConsumer(Producer<List<T>> producer) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkConsumed()
Implement this method to actualy check for the
Producer being fully consumed without worrying about it being closed
or throwing any exceptions |
void |
close() |
protected T |
doConsume()
Implement this method to actually consume the producer without worrying about exception types or checking fo this consumer to
be closed.
|
int |
getSize() |
consume, isConsumedprotected T doConsume() throws NoSuchElementException
nulldoConsume in class AbstractConsumer<T,List<T>>nullNoSuchElementExceptionprotected boolean checkConsumed()
AbstractConsumerProducer being fully consumed without worrying about it being closed
or throwing any exceptionscheckConsumed in class AbstractConsumer<T,List<T>>Producer has been consumed or notpublic int getSize()
getSize in interface org.mule.runtime.api.streaming.HasSizegetSize in class AbstractConsumer<T,List<T>>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractConsumer<T,List<T>>IOExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.