Skip to content

Commit

Permalink
Convert String predicate to ModuleSupplier predicate.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawalonoski authored and hadleynet committed Apr 3, 2024
1 parent 3762fd3 commit 2e587be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/mitre/synthea/engine/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ public static List<ModuleSupplier> getModuleSuppliers() {
* @param predicate A predicate to filter a module based on path.
* @return A list of ModuleSuppliers.
*/
public static List<ModuleSupplier> getModuleSuppliers(Predicate<String> predicate) {
public static List<ModuleSupplier> getModuleSuppliers(Predicate<ModuleSupplier> predicate) {
List<ModuleSupplier> list = new ArrayList<ModuleSupplier>();
modules.forEach((k, v) -> {
if (predicate.test(v.path)) {
if (predicate.test(v)) {
list.add(v);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,8 @@ public static void exportMetrics() {
Path output = Paths.get(baseDir, statsDir);
output.toFile().mkdirs();

List<ModuleSupplier> suppliers = Module.getModuleSuppliers();
List<ModuleSupplier> suppliers = Module.getModuleSuppliers(p -> !p.core);
for (ModuleSupplier supplier : suppliers) {
if (supplier.core) {
// Java module
continue;
}
// System.out.println("Saving statistics: " + supplier.path);

Map<String, Metric> moduleMetrics = metrics.row(supplier.get().name);
Expand Down

0 comments on commit 2e587be

Please sign in to comment.