Skip to content

Commit 1018da2

Browse files
committed
Refine README
1 parent 0b12f03 commit 1018da2

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ and adapters
77

88
[![Stargazers over time](https://starchart.cc/pivovarit/throwing-function.svg?variant=adaptive)](https://starchart.cc/pivovarit/throwing-function)
99

10-
## Rationale
10+
## Overview
1111

12-
Standard `java.util.function` Functional Interfaces aren't checked-exception-friendly due to the absence of `throws ...` clause which results in tedious and verbose necessity of handling them by adding `try-catch` boilerplate.
12+
Java’s standard `java.util.function` interfaces are not compatible with checked exceptions. This leads to verbose and cluttered code, requiring manual try-catch blocks for exception handling, which makes one-liners like this:
1313

14-
Which makes one-liners like this:
1514
```
1615
path -> new URI(path)
1716
```
@@ -27,17 +26,17 @@ path -> {
2726
}
2827
```
2928

30-
By applying `com.pivovarit.function` functional interfaces, it's possible to regain clarity and readability:
29+
This library introduces checked-exception-enabled functional interfaces, like `ThrowingFunction`, allowing cleaner, more concise code. You can now handle exceptions in functional pipelines without sacrificing readability:
3130

3231
ThrowingFunction<String, URI, URISyntaxException> toUri = URI::new;
3332

34-
and use them seamlessly with native `java.util.function` classes by using custom `ThrowingFunction#unchecked` adapters:
33+
Using the `ThrowingFunction#unchecked` adapter, this can be seamlessly integrated into standard streams:
3534

3635
...stream()
3736
.map(unchecked(URI::new)) // static import of ThrowingFunction#unchecked
3837
.forEach(System.out::println);
3938

40-
which avoids ending up with:
39+
This eliminates the need for bulky try-catch blocks within stream operations:
4140

4241
...stream().map(path -> {
4342
try {
@@ -46,7 +45,13 @@ which avoids ending up with:
4645
throw new RuntimeException(e);
4746
}}).forEach(System.out::println);
4847

49-
### Basic API
48+
### Key Features
49+
50+
- Functional Interfaces: Supports various functional types with checked exceptions.
51+
- Adapters: Provides utility methods to convert `Throwing*` types into standard Java functional interfaces.
52+
- Lightweight: No external dependencies, implemented using core Java libraries.
53+
54+
### Core API
5055

5156
#### Functional Interfaces
5257

@@ -95,6 +100,10 @@ None - the library is implemented using core Java libraries.
95100

96101
## Version history
97102

103+
## [1.6.0 (24-09-2024)](https://github.com/pivovarit/throwing-function/releases/tag/1.6.0)
104+
105+
* Added `Automatic-Module-Name` to MANIFEST
106+
98107
### [1.5.1 (06-05-2020)](https://github.com/pivovarit/throwing-function/releases/tag/1.5.1)
99108

100109
* Fixed visibility issues with `ThrowingIntFunction`

0 commit comments

Comments
 (0)