Class StreamUtils

    • Method Detail

      • stream

        public static <C> Stream<C> stream​(Collection<C> value)
        Creates a stream on the given collection if it is not null
        Parameters:
        value - the collection
        Returns:
        A stream of elements or an empty stream if the collection is null
      • stream

        public static <K,​V> Stream<Map.Entry<K,​V>> stream​(Map<K,​V> value)
        Creates a stream of entries on the given Map if it is not null
        Parameters:
        value - the map
        Returns:
        A stream of entries or an empty stream if the collection is null