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
- Clone the repository and use maven to generate a .jar file:
git clone https://github.com/JeffreyFalgout/ThrowingStream
cd ThrowingStream/
mvn package
- Download a .jar from the releases page
- Maven central:
<dependency>
<groupId>name.falgout.jeffrey</groupId>
<artifactId>throwing-streams</artifactId>
<version>X.Y.Z</version>
</dependency>
Check out the wiki.