Created
November 15, 2017 22:19
-
-
Save pcholt/db7e4f3367142fd01c8d2b9f3d05220f to your computer and use it in GitHub Desktop.
Join strings, but first filter each on a predicate
This file contains 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
return StringUtils.join( Stream.of( | |
customerDetails.getPersonalName(), | |
customerDetails.getMiddleName(), | |
customerDetails.getFamilyName() ).filter( Objects::nonNull ).iterator(), " "); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment