Skip to content

Instantly share code, notes, and snippets.

@shekibobo
Created January 16, 2015 19:15
Show Gist options
  • Save shekibobo/92f15c03b571fe9a42cf to your computer and use it in GitHub Desktop.
Save shekibobo/92f15c03b571fe9a42cf to your computer and use it in GitHub Desktop.
MyModel newModel = getNewModel();
MyModel oldModel = getOldModel();
String newValue = null;
newValue = newModel.getName();
if (newValue != null) {
oldModel.setName(newValue);
}
newValue = newModel.getEmail();
if (newValue != null) {
oldModel.setEmail(newValue);
}
newValue = newModel.getAddress();
if (newValue != null) {
oldModel.setAddress(newValue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment