Class IOUtils
java.lang.Object
org.jenkinsci.plugins.github.pullrequest.utils.IOUtils
Utilities for IOException handling in Streams
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> voidExecutes aStream.forEach(Consumer)on a stream that uses IO-versions of lambdas and spits out any thrown IOExceptionstatic <T,R> Function<T, R> iof(IOUtils.IOFunction<T, R> fun) Wraps provided Function into an IOFunction.static <V> Stream<V>ioOptStream(IOUtils.IOSupplier<V> supp) Creates a stream from a single element returned by provided IOSupplier.static <T> Predicate<T>iop(IOUtils.IOPredicate<T> pred) Wraps provided Predicate into an IOPredicate.static voidExecutes a terminal operation that uses IO-versions of lambdas and spits out any thrown IOExceptionstatic <V> VExecutes a terminal operation that uses IO-versions of lambdas and spits out any thrown IOException
-
Method Details
-
iof
Wraps provided Function into an IOFunction. Users are expected to wrap stream terminal operations usingwithIo(Runnable)orwithIo(Supplier) -
iop
Wraps provided Predicate into an IOPredicate. Users are expected to wrap stream terminal operations usingwithIo(Runnable)orwithIo(Supplier) -
withIo
Executes a terminal operation that uses IO-versions of lambdas and spits out any thrown IOException- Throws:
IOException
-
withIo
Executes a terminal operation that uses IO-versions of lambdas and spits out any thrown IOException- Throws:
IOException
-
forEachIo
Executes aStream.forEach(Consumer)on a stream that uses IO-versions of lambdas and spits out any thrown IOException- Throws:
IOException
-
ioOptStream
Creates a stream from a single element returned by provided IOSupplier. If supplier throws an IOException, returnsStream.empty()
-