Created
June 3, 2020 22:45
-
-
Save hkakutalua/54c1fb865f2096298a9c7b90a82f591f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.partialupdates.utils; | |
import org.openapitools.jackson.nullable.JsonNullable; | |
import java.util.function.Consumer; | |
public final class JsonNullableUtils { | |
private JsonNullableUtils() {} | |
public static <T> void changeIfPresent(JsonNullable<T> nullable, Consumer<T> consumer) { | |
if (nullable.isPresent()) { | |
consumer.accept(nullable.get()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment