diff options
author | Marko Zajc <marko@zajc.eu.org> | 2023-04-02 01:29:00 +0200 |
---|---|---|
committer | Marko Zajc <marko@zajc.eu.org> | 2023-04-02 01:29:00 +0200 |
commit | 2922f6e9b9c0f11b50f78e405675db0bfb052e47 (patch) | |
tree | 160417c506316a9d0a8c426689479749f6fc28dc | |
parent | 556f60aa8577153b37f4f40f2ddaa3fdbb1d158f (diff) |
Update README.md
-rw-r--r-- | README.md | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -5,16 +5,16 @@ A small project providing extensions and additions to Java 8's built-in function | |||
5 | ## Installation | 5 | ## Installation |
6 | 6 | ||
7 | Add the following to your pom.xml's dependencies: | 7 | Add the following to your pom.xml's dependencies: |
8 | 8 | ||
9 | ```xml | 9 | ```xml |
10 | <dependencies> | 10 | <dependencies> |
11 | ... | 11 | ... |
12 | <dependency> | 12 | <dependency> |
13 | <groupId>com.github.markozajc</groupId> | 13 | <groupId>com.github.markozajc</groupId> |
14 | <artifactId>extended-functions</artifactId> | 14 | <artifactId>extended-functions</artifactId> |
15 | <version>1.3</version> | 15 | <version>1.3</version> |
16 | </dependency> | 16 | </dependency> |
17 | ... | 17 | ... |
18 | </dependencies> | 18 | </dependencies> |
19 | ``` | 19 | ``` |
20 | 20 | ||
@@ -22,18 +22,18 @@ or your build.gradle: | |||
22 | 22 | ||
23 | ```groovy | 23 | ```groovy |
24 | repositories { | 24 | repositories { |
25 | ... | 25 | ... |
26 | mavenCentral() | 26 | mavenCentral() |
27 | ... | 27 | ... |
28 | } | 28 | } |
29 | 29 | ||
30 | dependencies { | 30 | dependencies { |
31 | ... | 31 | ... |
32 | api 'com.github.markozajc:extended-functions:1.3' | 32 | api 'com.github.markozajc:extended-functions:1.3' |
33 | ... | 33 | ... |
34 | } | 34 | } |
35 | ``` | 35 | ``` |
36 | 36 | ||
37 | ## Usage | 37 | ## Usage |
38 | 38 | ||
39 | Some of this project's additions do not extend Java 8's built-in functions and can therefore not be used directly with Java's APIs. However, those that do (specifically certain E\* and AE\* ones) can be through casting. For example, one can use: | 39 | Some of this project's additions do not extend Java 8's built-in functions and can therefore not be used directly with Java's APIs. However, those that do (specifically certain E\* and AE\* ones) can be through casting. For example, one can use: |
@@ -52,11 +52,11 @@ rather than the vanilla way of doing it: | |||
52 | 52 | ||
53 | ```java | 53 | ```java |
54 | files.forEach(t -> { | 54 | files.forEach(t -> { |
55 | try { | 55 | try { |
56 | Files.delete(t); | 56 | Files.delete(t); |
57 | } catch (IOException e) { | 57 | } catch (IOException e) { |
58 | // the error handling logic | 58 | // the error handling logic |
59 | } | 59 | } |
60 | }); | 60 | }); |
61 | ``` | 61 | ``` |
62 | 62 | ||
@@ -68,7 +68,7 @@ It's also possible to handle exceptions in-line with `EHandle`: | |||
68 | 68 | ||
69 | ```java | 69 | ```java |
70 | files.forEach(EHandle.handle(Files::delete, (f, t) -> { | 70 | files.forEach(EHandle.handle(Files::delete, (f, t) -> { |
71 | // error handling logic | 71 | // error handling logic |
72 | })); | 72 | })); |
73 | ``` | 73 | ``` |
74 | 74 | ||