Generic, Null-safe, Immutable Collections and Functional Transformations for the JVM
Do NOT use release 3.10.2. That was a mistake!
@NotNull
annotation to the generic type parameter returned by Transformable.whereNonNull()
(and implementation of that method in UnmodIterable).
@NotNull Transformable<T> whereNonNull()
@NotNull Transformable<@NotNull T> whereNonNull()
OneOf5
. A second-class Union Type like OneOf4
, but with one more.OneOf2OrNone
; use Option<OneOf2>
instead.
The OneOf2OrNoneTest shows how.@Nullable
to @NotNull
and from private
to protected
.
If you use @NotNull
annotations in your subclass, you can now overload the static factory methods in your subclasses (you can use the same name for all of them).
Instead of storing null in a OneOf_
, simply return a null
OneOf_ or Option<OneOf_>.none()
.
The protected
modifier now lets subclasses access the contained item for easily implementing an interface that the possible values share.
The OneOf2Test shows how.The following are results of usage and casual code review.
appendSome(@NotNull Fn0<? extends @NotNull Option<E>> supplier)
private static final long serialVersionUID
field.
This was always intended to be there
(so you can serialize with one version of Paguro and deserialize with another)
but was generated as part of comment by accident.
This field will not change so long as tuples do not change in a way that affects their serialization.Fixed some nullability annotations in StaticImports to work with Kotlin 1.4.21.
Still waiting on this to appear on maven central... they are slow right now.
Release 3.5.8 2020-10-06
Here is a script to ease your upgrade from 3.0 or 3.2 to 3.5
# USE CAUTION AND HAVE A BACKUP OF YOUR SOURCE CODE (VERSION CONTROL) - NO GUARANTEES
oldString='MutableList'
newString=MutList
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableMap'
newString=MutMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableSet'
newString=MutSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='toMutableSortedSet'
newString=toMutSortedSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='toMutableSortedMap'
newString=toMutSortedMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableHashSet'
newString=MutHashSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableHashMap'
newString=MutHashMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
After the above, you probably want to check out any Kotlin files. Sorry. If you use MutableMap/MutableList/etc. inside a Kotlin file, you have to fix it manually. Sorry.