Skip to content

Commit

Permalink
allowing the use of StorageName() to skip storing a field
Browse files Browse the repository at this point in the history
  • Loading branch information
eonwhite committed Jan 25, 2019
1 parent a7ece0a commit f92647b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ protected Item renameItem(Item item, Map<String,String> renames) {
Item renamedItem = new Item();
for (String key : map.keySet()) {
String renamedKey = renames.getOrDefault(key, key);
renamedItem.with(renamedKey, item.get(key));
if (renamedKey != null && !"".equals(renamedKey)) {
renamedItem.with(renamedKey, item.get(key));
}
}
return renamedItem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ protected Document renameDocument(Document doc, Map<String,String> renames) {
Document renamedDoc = new Document();
for (String key : doc.keySet()) {
String renamedKey = renames.getOrDefault(key, key);
renamedDoc.put(renamedKey, doc.get(key));
if (renamedKey != null && !"".equals(renamedKey)) {
renamedDoc.put(renamedKey, doc.get(key));
}
}
return renamedDoc;
}
Expand Down

0 comments on commit f92647b

Please sign in to comment.