eclipse / eclipse-collections

Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.

Home Page:http://www.eclipse.org/collections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create primitiveStream methods for IntBag, LongBag and DoubleBag

donraab opened this issue · comments

Since 10.0, we have had primitiveStream on IntList, LongList and DoubleList. This makes the following possible:

List<String> list = IntLists.immutable.of(1, 2, 3)
        .primitiveStream()
        .mapToObj(Integer::toString)
        .toList();

Assertions.assertEquals(List.of("1", "2", "3"), list);

There is no equivalent for IntBag, LongBag, and DoubleBag today. This will additionally require creating spliterator() for each of these.

hi @donraab - happy to take a look at this

Thanks for volunteering @Desislav-Petrov! I have assigned the issue to you.