Skip to content

Add peek extension method for Iterable and Iterator #9

@Boereck

Description

@Boereck

Analogous to the JDK method java.lang.Stream#peek(java.util.function.Consumer) introduce a peek extension method for Iterable and Iterator. This method just consumes an element and produces an Iterable/Iterator providing the same elements as the source. This method is mainly interesting for debugging purposes.

  • static def <T> Iterable<T> peek(Iterable<T> iterable, (T)=>void action)
  • static def <T> Iterator<T> peek(Iterator<T> iterator, (T)=>void action)

If you want this ticket to be implemented, please give feedback, since it is only implemented on demand.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions