Created
May 30, 2019 22:56
-
-
Save rmcdouga/a0cfce334af8cab2ede05c8acc0beecf to your computer and use it in GitHub Desktop.
Set if Not Null
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
private <T> void setIfNotNull(final Consumer<T> setter, final T value) { | |
if (value != null) { | |
setter.accept(value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment