<commit_before>Disclaimer: This is not an official Google product.

# MµG
A small Java 9 utilities library ([javadoc](http://google.github.io/mug/apidocs/index.html)), with 0 deps. ![](https://travis-ci.org/google/mug.svg?branch=master)

* Stream utilities ([BiStream](#bistream-streams-pairs-of-objects), [MoreStreams](#morestreams)).
* [Optionals](#optionals) provides extra utilities for java.util.Optional.
* [Substring](#substring) does string slicing.
* [Retryer](#retryer) retries.
* [Maybe](#maybe) tunnels checked exceptions through streams or futures.
* [Funnel](#funnel) flows objects through batch conversions in FIFO order.
* [Parallelizer](#parallelizer) Runs a pipeline of tasks in parallel while limiting the number of in-flight tasks.
* Functional interfaces that allow checked exceptions.

## Maven

Add the following to pom.xml:
```
  <dependency>
    <groupId>com.google.mug</groupId>
    <artifactId>mug</artifactId>
    <version>3.0</version>
  </dependency>
```

## Stream

#### [BiStream](https://google.github.io/mug/apidocs/com/google/mu/util/stream/BiStream.html) streams pairs of objects.

This class closely mirrors Jdk `Stream` API (the few extra methods of "its own" are very straight-forward). If you are familiar with Jdk stream, learning curve is minimal.

**Example 1: to concatenate `Map`s:**<commit_msg>change README to Java 8 requirement<commit_after>Disclaimer: This is not an official Google product.

# MµG
A small Java 8 utilities library ([javadoc](http://google.github.io/mug/apidocs/index.html)), with 0 deps. ![](https://travis-ci.org/google/mug.svg?branch=master)

* Stream utilities ([BiStream](#bistream-streams-pairs-of-objects), [MoreStreams](#morestreams)).
* [Optionals](#optionals) provides extra utilities for java.util.Optional.
* [Substring](#substring) does string slicing.
* [Retryer](#retryer) retries.
* [Maybe](#maybe) tunnels checked exceptions through streams or futures.
* [Funnel](#funnel) flows objects through batch conversions in FIFO order.
* [Parallelizer](#parallelizer) Runs a pipeline of tasks in parallel while limiting the number of in-flight tasks.
* Functional interfaces that allow checked exceptions.

## Maven

Add the following to pom.xml:
```
  <dependency>
    <groupId>com.google.mug</groupId>
    <artifactId>mug</artifactId>
    <version>3.0</version>
  </dependency>
```

## Stream

#### [BiStream](https://google.github.io/mug/apidocs/com/google/mu/util/stream/BiStream.html) streams pairs of objects.

This class closely mirrors Jdk `Stream` API (the few extra methods of "its own" are very straight-forward). If you are familiar with Jdk stream, learning curve is minimal.

**Example 1: to concatenate `Map`s:**
{'fraction_non_alphanumeric': 0.13323464100666174, 'fraction_numerical': 0.0040710584752035525, 'mean_word_length': 5.115384615384615, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1231404', 'n_tokens_mistral': 874, 'n_tokens_neox': 794, 'n_words': 252}