Class Java9BackportUtils


  • public class Java9BackportUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​U,​A,​R>
      java.util.stream.Collector<T,​?,​R>
      flatMapping​(java.util.function.Function<? super T,​? extends java.util.stream.Stream<? extends U>> mapper, java.util.stream.Collector<? super U,​A,​R> downstream)  
      static <T> void ifPresentOrElse​(java.util.Optional<T> optional, java.util.function.Consumer<? super T> action, java.lang.Runnable emptyAction)  
      static <T> java.util.stream.Stream<T> toStream​(java.util.Optional<T> optional)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Java9BackportUtils

        public Java9BackportUtils()
    • Method Detail

      • flatMapping

        public static <T,​U,​A,​R> java.util.stream.Collector<T,​?,​R> flatMapping​(java.util.function.Function<? super T,​? extends java.util.stream.Stream<? extends U>> mapper,
                                                                                                            java.util.stream.Collector<? super U,​A,​R> downstream)
      • ifPresentOrElse

        public static <T> void ifPresentOrElse​(java.util.Optional<T> optional,
                                               java.util.function.Consumer<? super T> action,
                                               java.lang.Runnable emptyAction)
      • toStream

        public static <T> java.util.stream.Stream<T> toStream​(java.util.Optional<T> optional)