io.engineblock.activities.json.statements.FileStmtDocList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of at-json Show documentation
Show all versions of at-json Show documentation
A engineblock ActivityType (AT) driver module;
Provides an activity capable of writing results out via JSON
package io.engineblock.activities.json.statements;
import io.engineblock.util.TagFilter;
import java.util.*;
import java.util.stream.Collectors;
public class FileStmtDocList {
private List fileStmtDocList = new ArrayList<>();
public FileStmtDocList(List fileStmtDocList) {
this.fileStmtDocList = fileStmtDocList;
}
public Map getFilteringDetails(String spec) {
Map details = new LinkedHashMap<>();
TagFilter ts = new TagFilter(spec);
for (FileStmtDoc gsb : this.fileStmtDocList) {
TagFilter.Result result = ts.matchesTaggedResult(gsb);
details.put(gsb.getName(), result.getLog());
}
return details;
}
public List getMatching(String tagSpec) {
List matchingBlocks = new ArrayList<>();
TagFilter ts = new TagFilter(tagSpec);
return this.fileStmtDocList.stream().filter(ts::matchesTagged).collect(Collectors.toList());
}
public List getAll() {
return Collections.unmodifiableList(this.fileStmtDocList);
}
}