Skip to content

Commit

Permalink
Release 1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
aNNiMON committed Mar 1, 2017
1 parent 0f2b385 commit 3fc22c5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ In addition to backported Java 8 Stream operators, the library provides:
stream.select(Integer.class)
```

- `withoutNulls` - filters only not null elements

```java
Stream.of("a", null, "c", "d", null)
.withoutNulls() // [a, c, d]
```

- `sortBy` - sorts by extractor function

```java
Expand Down Expand Up @@ -131,13 +138,28 @@ In addition to backported Java 8 Stream operators, the library provides:
.dropWhile(s -> s.length() == 1) // [cd, ef, g]
```

- `indexed` - add index to every element, result is `IntPair`
- `scan` - iteratively applies accumulation function and returns Stream

```java
IntStream.range(1, 6)
.scan((a, b) -> a + b) // [1, 3, 6, 10, 15]
```

- `indexed` - adds an index to every element, result is `IntPair`

```java
Stream.of("a", "b", "c")
.indexed() // [(0 : "a"), (1 : "b"), (2 : "c")]
```

- `filterIndexed` / `mapIndexed` / `takeWhileIndexed` / `takeUntilIndexed` / `dropWhileIndexed` / `reduceIndexed` / `forEachIndexed` - indexed specialization of operators

```java
Stream.of("a", "b", "c")
.mapIndexed((i, s) -> s + Integer.toString(i)) // [a0, b1, c2]
```


### Throwable functions

No more ugly try/catch in lambda expressions.
Expand All @@ -164,15 +186,15 @@ Download [latest release](https://github.com/aNNiMON/Lightweight-Stream-API/rele
<dependency>
<groupId>com.annimon</groupId>
<artifactId>stream</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
</dependency>
```
or Gradle:

```groovy
dependencies {
...
compile 'com.annimon:stream:1.1.5'
compile 'com.annimon:stream:1.1.6'
...
}
```
Expand Down
2 changes: 1 addition & 1 deletion stream/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java-library'
apply plugin: 'maven'

archivesBaseName = 'stream'
version = '1.1.5-SNAPSHOT'
version = '1.1.6-SNAPSHOT'
group = 'com.annimon'
ext.isReleaseVersion = !version.contains("SNAPSHOT")

Expand Down
4 changes: 2 additions & 2 deletions stream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.annimon</groupId>
<artifactId>stream</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -33,7 +33,7 @@
<connection>scm:git:git@github.com:aNNiMON/Lightweight-Stream-API.git</connection>
<developerConnection>scm:git:git@github.com:aNNiMON/Lightweight-Stream-API.git</developerConnection>
<url>git@github.com:aNNiMON/Lightweight-Stream-API.git</url>
<tag>v1.1.5</tag>
<tag>v1.1.6</tag>
</scm>

<distributionManagement>
Expand Down
2 changes: 1 addition & 1 deletion streamTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java-library'
apply plugin: 'maven'

archivesBaseName = 'stream-test'
version = '1.1.5-SNAPSHOT'
version = '1.1.6-SNAPSHOT'
group = 'com.annimon'
ext.isReleaseVersion = !version.contains("SNAPSHOT")

Expand Down

0 comments on commit 3fc22c5

Please sign in to comment.