Skip to content

Commit

Permalink
Rename argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
gk-brown committed May 21, 2024
1 parent d36fb28 commit b88a771
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ The `Optionals` class contains methods for working with optional (or "nullable")

```java
public static <T> T coalesce(T... values) { ... }
public static <T, U> U map(T value, Function<? super T, ? extends U> action) { ... }
public static <T, U> U map(T value, Function<? super T, ? extends U> transform) { ... }
public static <T> void perform(T value, Consumer<? super T> action) { ... }
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

subprojects {
group = 'org.httprpc'
version = '4.0.1'
version = '4.0.2'

apply plugin: 'java-library'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ public static <T> T coalesce(T... values) {
* @param value
* The optional value.
*
* @param action
* @param transform
* The mapping function to apply.
*
* @return
* The result of applying the mapping function to the provided value, or
* {@code null} if the value was {@code null}.
*/
public static <T, U> U map(T value, Function<? super T, ? extends U> action) {
if (action == null) {
public static <T, U> U map(T value, Function<? super T, ? extends U> transform) {
if (transform == null) {
throw new IllegalArgumentException();
}

return (value == null) ? null : action.apply(value);
return (value == null) ? null : transform.apply(value);
}

/**
Expand Down

0 comments on commit b88a771

Please sign in to comment.