Created
October 17, 2013 12:10
-
-
Save hamnis/7023779 to your computer and use it in GitHub Desktop.
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
public class TemplateFill { | |
public Template fill(Map<String, String> values, template: Template) { | |
Data data = template.getData(); | |
List<Property> newData = new ArrayList<>(); | |
for (Property p: data) { | |
if (values.contains(p.getName()) { | |
newData.add(p.withValue(values.get(p.getName())); | |
} | |
} | |
return new Data(newData) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment