Skip to content

Add Seq<T> onEmptySwitch(Supplier<? extends Stream<? extends T>>) #179

@lukaseder

Description

@lukaseder

As suggested by @johnmcclean-aol (#177 (comment)), an onEmptySwitch(Supplier<? extends Stream<? extends T>>) method might be useful in some situations.

Criticism:

  • The current onEmptyXXX() names were inspired by Optional.orElseXXX(). We should think about the term switch, or if there is any more suitable term for this action
  • Due to generic type erasure, we cannot overload a single onEmptySwitch(Supplier<E>) method with different bounds for <E>. What would be the best upper bound? Seq? Stream? Iterable?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions