Skip to content

Commit 5479eee

Browse files
committed
Add more usage examples in README
1 parent 1fb29f6 commit 5479eee

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ You can ignore any errors and only use the `ok` values _(when available)_.
7171
pe.imports.ifOk(imports -> printImports(imports));
7272
```
7373

74-
Or, you can use a classic `null` check.
74+
Or, you can use a classic `null` check _(and log errors on the side)_.
7575

7676
```java
77-
ArrayList<LibraryImports> imports = pe.imports.getOkOrDefault(null);
77+
ArrayList<LibraryImports> imports = pe.imports
78+
.ifErr(err -> System.out.println(err)) // Optional call
79+
.getOkOrDefault(null);
80+
7881
if (imports != null)
7982
printImports(imports);
8083
```

0 commit comments

Comments
 (0)