public class ListConsumer<T> extends AbstractConsumer<T,List<T>>
Consumer
that obains 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()
Closes the resource.
|
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 |
size()
returns the total amount of items available for storage/processing.
|
consume, isConsumed
protected T doConsume() throws NoSuchElementException
null
doConsume
in class AbstractConsumer<T,List<T>>
null
NoSuchElementException
protected boolean checkConsumed()
AbstractConsumer
Producer
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 size()
size
in interface ProvidesTotalHint
size
in class AbstractConsumer<T,List<T>>
public void close() throws MuleException
close
in interface Closeable
close
in class AbstractConsumer<T,List<T>>
MuleException
- if an exception occurs closing the resourceCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.