Created
January 24, 2012 17:18
-
-
Save stuartrexking/1671252 to your computer and use it in GitHub Desktop.
Mkae this leaner
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
private void mapCover(ProfileDocument profileDocument, UpdateProfile updateProfile) { | |
boolean updateTitle = StringUtils.isNotBlank(updateProfile.getCoverTitle()); | |
boolean updateCoverMedia = CollectionUtils.isMapNotEmpty(updateProfile.getCoverMedia()); | |
if (updateTitle || updateCoverMedia) { | |
UserCoverDocument document = profileDocument.getCover(); | |
if (null == document) { | |
document = new UserCoverDocument(); | |
profileDocument.setCover(document); | |
} | |
document.setCover_title(updateProfile.getCoverTitle()); | |
if (updateCoverMedia) { | |
document.setCover_media(CollectionUtils.asStringMap(updateProfile.getCoverMedia())); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment