Skip to content

Instantly share code, notes, and snippets.

@hamnis
Created October 17, 2013 12:10
Show Gist options
  • Save hamnis/7023779 to your computer and use it in GitHub Desktop.
Save hamnis/7023779 to your computer and use it in GitHub Desktop.
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