Utilities for handling exceptions.
// Automatically handle checked exceptions.
List<String> lines =
Attempt.ignoring().get(() -> Files.readAllLines(Path.of("example.txt"))).orElseGet(List::of);
// Create checked versions of all standard functional interfaces.
CheckedSupplier<List<String>, IOException> getFileLines = () -> Files.readAllLines(Path.of("example.txt"));
<dependency>
<groupId>com.rezzedup.util</groupId>
<artifactId>exceptional</artifactId>
<version><!--release--></version>
</dependency>
Find available versions on the releases page of this repository.
Maven Central: https://search.maven.org/artifact/com.rezzedup.util/exceptional
Note: Snapshot Versions
ℹ️ Snapshot releases are available at the following repository:
<repositories> <repository> <id>ossrh-snapshots</id> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </repository> </repositories>
Note: Shading
ℹ️ If you intend to shade this library, please consider relocating the packages to avoid potential conflicts with other projects. This library also utilizes nullness annotations, which may be undesirable in a shaded uber-jar. They can safely be excluded, and you are encouraged to do so.
Javadoc: https://javadoc.io/doc/com.rezzedup.util/exceptional