public final class GroupIterator extends Object implements Iterator<Object>, Closeable
Iterator
which groups the given Iterator
a number of times
and then return a combined response as a String.
This implementation uses as internal byte array buffer, to combine the response.
The token is inserted between the individual parts.
For example if you group by new line, then a new line token is inserted between the lines.Constructor and Description |
---|
GroupIterator(CamelContext camelContext,
Iterator<?> it,
String token,
int group)
Creates a new group iterator
|
public GroupIterator(CamelContext camelContext, Iterator<?> it, String token, int group)
camelContext
- the camel contextit
- the iterator to grouptoken
- then token used to separate between the parts, use null to not add the tokengroup
- number of parts to group togetherIllegalArgumentException
- is thrown if group is not a positive numberpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Apache Camel