Skip to content

Commit

Permalink
Release 3.10.1 2022-03-18: NotNull whereNotNull()
Browse files Browse the repository at this point in the history
 - Added `@NotNull` annotation to the generic type parameter returned by Transformable.whereNonNull()
   (and implementation of that method in UnmodIterable).
   - Was: `@NotNull Transformable<T> whereNonNull()`
   - Now: `@NotNull Transformable<@NotNull T> whereNonNull()`
  • Loading branch information
GlenKPeterson committed Mar 18, 2022
1 parent 99dac3f commit 13d474c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGE_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ releases on the way from an old version to a new one. Fix any deprecation warni
release before upgrading to the next one. The documentation next to each Deprecated annotation
tells you what to use instead. Once we delete the deprecated methods, that documentation goes too.

## Release 3.10.1 2022-03-18: NotNull whereNotNull()
- Added `@NotNull` annotation to the generic type parameter returned by Transformable.whereNonNull()
(and implementation of that method in UnmodIterable).
- Was: `@NotNull Transformable<T> whereNonNull()`
- Now: `@NotNull Transformable<@NotNull T> whereNonNull()`

## Release 3.10.0 2022-01-21: "OneOf5"
- Added OneOf5. A second-class Union Type like OneOf4, but with one more.
- Removed OneOf2OrNone; use Option<OneOf2> instead.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ http://mvnrepository.com/artifact/org.organicdesign/Paguro
-->
<groupId>org.organicdesign</groupId>
<artifactId>Paguro</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<packaging>jar</packaging>

<name>Paguro</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ default <B> B fold(B ident, @NotNull Fn2<? super B,? super T,B> reducer) {
}

/** {@inheritDoc} */
@Override default @NotNull UnmodIterable<T> whereNonNull() {
@Override default @NotNull UnmodIterable<@NotNull T> whereNonNull() {
return Xform.of(this).filter(Objects::nonNull);
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/organicdesign/fp/xform/Transformable.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ Add items to the end of this Transformable (precat() adds to the beginning)
@NotNull Transformable<T> filter(@NotNull Fn1<? super T,Boolean> predicate);

/**
Return only the items which are non-null
@return a Transformable of only the non-null items.
* Return only the items which are non-null
* @return a Transformable of only the non-null items.
*/
@NotNull Transformable<T> whereNonNull();
@NotNull Transformable<@NotNull T> whereNonNull();

/**
Returns the first item produced by this transform. If the source is unordered, there is no guarantee about which
Expand Down

0 comments on commit 13d474c

Please sign in to comment.