Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266604

Enhance Stream.ofNullable with a collection as input

    XMLWordPrintable

Details

    Description

      A DESCRIPTION OF THE PROBLEM :
      ofNullable to have a collection as input. So a stream of elements are initialized instead of the collection.

      public static <T> Stream<T> ofNullable(Collection<T> collection) {
          return collection == null ? Stream.empty() : collection.stream();
        }


      Attachments

        Activity

          People

            vklang Viktor Klang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: