/ThrowingStream

A version of java.util.stream that allows for checked exceptions to be thrown.

Primary LanguageJavaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

ThrowingStream

Maven Central

This project is an alternative API to java.util.stream and its various supporting interfaces that allows for checked exceptions to be thrown.

Example usage:

Stream<String> names = Stream.of("java.lang.Object", "java.util.stream.Stream");
ThrowingStream<String, ClassNotFoundException> s = ThrowingStream.of(names, 
    ClassNotFoundException.class);
s.map(ClassLoader.getSystemClassLoader()::loadClass).forEach(System.out::println);

Output:

class java.lang.Object
interface java.util.stream.Stream

###How can I use this library in my project?

git clone https://github.com/JeffreyFalgout/ThrowingStream
cd ThrowingStream/
mvn package
<dependency>
    <groupId>name.falgout.jeffrey</groupId>
    <artifactId>throwing-streams</artifactId>
    <version>X.Y.Z</version>
</dependency>

###How does it work? Check out the wiki.