Skip to content

Experiment in creating a collector for Java 8 streams that accumulates into arbitrary batches.

License

Notifications You must be signed in to change notification settings

adaphi/batch-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

batch-collector

A simple experiment in creating a collector for Java 8 streams that accumulates into arbitrary batches.

The idea was to have a collector that could turn a Stream into a Collection of Collections, where each of the sub-Collections contains a maximum of n elements (where n is the batch size).

BatchInline is an attempt to make the collector as concise as possible, at the cost of some flexibility.

BatchCollector is an attempt to make a fully-implemented collector class where each Collection (inner and outer) can be specified by passing a Supplier<Collection> to the constructor (e.g. ArrayList::new)

About

Experiment in creating a collector for Java 8 streams that accumulates into arbitrary batches.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages