Releases: aNNiMON/Lightweight-Stream-API
Releases · aNNiMON/Lightweight-Stream-API
v1.2.2
- Added
teeingcollector (from Java 12) - Added
mapMultioperator for all streams andmapMultiToInt,mapMultiToLong,mapMultiToDoubleto objectStream(from Java 16) - Added
findFirstOrElse(defaultValue),append(T),prepend(T)toStream(thanks to @wjtxyz) concatnow supports 3+ streams or iterators- Added
SpinedBufferfor objects.SpinedBuffernow public, but it slightly differs from Java 8 API. - Fixed unnecessary unboxing of
dropWhile,takeUntil,filterIndexed,mapIndexedandscanoperators in primitive streams - Methods marked with nullability annotations
- Many other improvements
v1.2.1
- Added
ofNullablefor primitive Optionals (thanks to @mannodermaus) - Added
filterIndexed,mapIndexed,forEachIndexedoperators to primitive streams (thanks to @PromanSEW) - Added an ability to combine multiple predicates (thanks to @SunnyJithin for suggestion)
- Added
isEmptymethod for Optionals (from Java 11)
v1.2.0
- Added
Optional.mapToBoolean(thanks to @bejibx) - Added
Stream.equalsOnlyoperator (thanks to @operando) - Added
deepEquals,requireNonNullElse,requireNonNullElseGet,isNull,nonNullandrequireNonNullElementsmethods toObjects(thanks @ened for suggestion) - Added
orElseThrow()method toOptionalclasses. Please, prefer this method instead ofget()as it better reflects the behavior of the method - Added
toUnmodifiableList(),toUnmodifiableSet()andtoUnmodifiableMap()collectors from Java 10 (thanks to @javadev and @PromanSEW). See PromanSEW's comment - The
Collectors.toMapimplementation was changed to match Java 8 specs.toMap(keyMapper),toMap(keyMapper, valueMapper)andtoMap(keyMapper, valueMapper, mapFactory)now disallows duplicate keys. If the mapped keys contain duplicates, use newtoMap(keyMapper, valueMapper, mergeFunction)andtoMap(keyMapper, valueMapper, mergeFunction, mapFactory)methods - Removed useless
FunctionalInterfaceannotation - Removed deprecated
Stream.getIteratormethod
v1.1.9
- Added custom operators for Optionals (thanks to @dr-projectiro for suggestion)
- Added
filterNotfor Optionals - Added
Stream.mergeoperator (thanks to @landawn) - Added
Stream.concatfor iterators - Added
Stream.ofNullablefor array, map and iterator (thanks to @petnagy) - Added
Collectors.partitioningBy - Added
getOrElse(Supplier),isPresentand custom operators support forExceptional(thanks to @PromanSEW)
v1.1.8
- Added
findIndexedoperator. Thanks to @PromanSEW - Added an ability to run action after closing streams. Stream classes now implements
Closeable,closeandonClosemethods are added. Thanks to @frett
Notice that it is not necessary to close all streams. Please, refer to official Stream API documentation: https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html - Added IntStream
ofCodePoints. Thanks to @arturogutierrez - Added
OptionalBooleanand boolean functional interfaces. Thanks to @PromanSEW - Added
distinctByandfindLastoperators. Small optimization ofdistinctoperator. Thanks to @landawn
streamTest
- Added
OptionalBooleanMatcher
v1.1.7
- Added primitive throwable interfaces and
Util.safeconverters. Thanks to @PromanSEW - Improved comparators chaining in
ComparatorCompat. Thanks to @BattleShipPark - Fixed
filteroperator in primitive streams. Thanks to @romainpiel - Removed deprecated
Stream.ofRangemethods. - Iterators moved to separate package.
Warning
If you're using PrimitiveIterator, PrimitiveExtIterator or LsaExtIterator to create own custom operators, please, fix imports:
// Before
import com.annimon.stream.PrimitiveIterator;
import com.annimon.stream.LsaExtIterator;
// After
import com.annimon.stream.iterator.PrimitiveIterator;
import com.annimon.stream.iterator.LsaExtIterator;If you're using ComparatorCompat.chain, see #110
streamTest
StreamMatcher.elementsnow usesIterablematcher- Removed deprecated
StreamMatcher.isNotEmptymethod
v1.1.6
- Added
Stream.withoutNulls()Stream.nullsOnly()andPredicate.Util.notNull(). Thanks to @IlyaGulya - Added Java 8
Comparatorbackport. Thanks to @BattleShipPark - Added
Objects.compareIntandObjects.compareLong— backport of Java 7Integer.compareandLong.compare - Added
takeUntilandscanoperators - Added indexed operators:
filterIndexed,mapIndexed,takeWhileIndexed,takeUntilIndexed,dropWhileIndexed,reduceIndexed,forEachIndexedand indexed functional interfaces.
Many thanks to @dalewking for help and suggestions. - Fixed unnecessary boxing in
filter,flatMap,scanandsingleoperators of primitive streams. - Reduced calls to first iterator in
Stream.concat - Stream operators now placed into named classes in separate package. It can speed up the execution and improve stack trace readability. See an example.
- Many other fixes and improvements.
streamTest
-
Added stream custom operator assertions:
Stream.range(1, 4).custom(assertElements(contains(1, 2, 3)))
-
Update mockito to 2.7.13
v1.1.5
- Added
Stream.ofNullable(T element)andStream.ofNullable(iterable)methods - Added
Stream.toList()which can be much faster and convenient thancollect(Collectors.toList())(thanks to @akonior for both great ideas) - Fixed NPE in
flatMapiterator of primitive streams - New faster implementation of
Stream.distinct() - Added
iterate(T seed, Predicate p, UnaryOperator op)method for all streams
v1.1.4
- Added
LongStreamandDoubleStream - Added
OptionalLongandOptionalDouble - Added functional interfaces for operating with long and double primitive types
- Added
Exceptional.of(Throwable)factory method (thanks to @arturdm) - Added
mapToLong,mapToDouble,flatMapToLong,flatMapToDoubletoStream - Added
mapToLong,mapToDoubletoIntStream - Added
mapToLong,mapToDoubletoOptional - Added
filter,ifPresentOrElse,mapToLongandmapToDoublemethods toOptionalInt - Added
longsanddoublesmethods toRandomCompat - Fixed
IllegalArgumentExceptioninRandomCompatintsmethod, when bound is greater than max int - Fixed
IntStreamrangeCloseddeadlock onInteger.MAX_VALUEbound StreamrangeandrangeClosednow usesIntStream/LongStreaminternally- Removed unnecessary abstraction in primitive streams
- Small other optimizations and javadocs fixes
streamTest
- Added
IntStreamMatcher,LongStreamMatcherandDoubleStreamMatcher - Added
OptionalLongMatcher,OptionalDoubleMatcher - Updated mockito version to 2.2.17
v1.1.3
- Added
summingInt,summingLong,summingDouble,averagingInt,averagingLong,averagingDoublecollectors - Added
flatMappingandfilteringcollectors, which introduced in Java 9 - Added
ToLongFunctionandToDoubleFunctioninterfaces - Added
Optional.mapToInt,OptionalInt.mapandOptionalInt.mapToObjmethods - Added
IntStream.single,IntStream.findSinglemethods Collectors.countingnow usessummingLongto avoid unnecessary boxingCollectors.averagingnow deprecated and usesaveragingDoubleinternally, also fixed NaN result for empty stream- Improved JavaDocs