Closed CC007 closed 1 year ago
It would also be nice if the IntelliJ plugin showed these method signature conflict issues before compilation.
Yep, I agree with you here regarding the naming, they should have been more specific, or perhaps should have just worked with streams. Renaming these could bother some folks, however. I haven't received much feedback around collection extensions etc., so I'll consider renaming and asking for forgiveness or back out the changes if need be.
You could maybe add the correct name as well and mark the old one as @Deprecated(forRemoval = true)
and wait for your next major release to actually remove it.
Describe the inconsistency The class ManIterableExt contains (among others) the following extension methods:
filterToList(predicate)
filterTo(destination, predicate)
filterIndexedToList(indexedPredicate)
filterIndexedTo(destination, indexedPredicate)
These are nice and consistent, with a
List<T>
or a chosen destinationCollection<? super T>
as a result and still allowing for afilter
andfilterIndexed
to be implemented, which would return aStream<T>
.If you look at the
map
variants though, I would expect:mapToList(transform)
mapTo(destination, transform)
mapIndexedToList(indexedTransform)
mapIndexedTo(destination, indexedTransform)
However instead of
mapIndexedToList
, the method is namedmapIndexed
. As a result, it is impossible to create your own extension method that is calledmapIndexed
that would return a stream.The same is true for
mapNotNull
, which should have beenmapNotNullToList
andmapIndexedNotNull
, which should have beenmapIndexedNotNullToList
Desktop (please complete the following information):