All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.engineblock.activities.json.statements.FileStmtDocList Maven / Gradle / Ivy

Go to download

A engineblock ActivityType (AT) driver module; Provides an activity capable of writing results out via JSON

There is a newer version: 1.0.65
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy