Skip to content

Grouping by collector #1

@OLBEA20

Description

@OLBEA20

AS a user of Jivago Streams I would like to be able to perform a grouping by reduction on my streams SO that I can perform more advanced functional style actions.

Example of desired behavior:

class Person: 
  age: int,
  name: string

people: List[Person] = [{age: 10, name: Toto}, {age:10, name: Bob}, {age:12, name: Julie}]

people_grouped_by_age = Stream(people).gouping_by(person.age) \Not sure if person.age could be accessed just like that

print(people_grouped_by_age)
Output: [[{age: 10, name:Toto}, {age: 10, name: Bob}], [{age:12, name:Julie}]]

Java doc: https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions