This library is an extension to the great jOOλ library. It mainly provides native handling of pair streams.
final Seq2<String> words = Seq2.of("foo", "bar", "foo");
final Map<String, Integer> wordCounts = words.mapToPair(Function.identity(), s -> 1)
.reduceByKey(Integer::sum)
.toMap();
System.out.println(wordCounts);
// {bar=1, foo=2}
You can add seq2 via Maven Central.
compile group: 'com.bakdata.seq2', name: 'seq2', version: '1.0.0'
<dependency>
<groupId>com.bakdata.seq2</groupId>
<artifactId>seq2</artifactId>
<version>1.0.0</version>
</dependency>
For other build tools or versions, refer to the latest version in MvnRepository.
If you want to contribute to this project, you can simply clone the repository and build it via Gradle. All dependencies should be included in the Gradle files, there are no external prerequisites.
> git clone [email protected]:bakdata/seq2.git
> cd seq2 && ./gradlew build
Please note, that we have code styles for Java. They are basically the Google style guide, with some small modifications.
We are happy if you want to contribute to this project. If you find any bugs or have suggestions for improvements, please open an issue. We are also happy to accept your PRs. Just open an issue beforehand and let us know what you want to do and why.
This project is licensed under the MIT license. Have a look at the LICENSE for more details.