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

io.engineblock.activities.csv.statements.CSVStmtDocList Maven / Gradle / Ivy

Go to download

A engineblock ActivityType (AT) driver module; Provides a diagnostic activity that logs input at some interval

There is a newer version: 2.11.04
Show newest version
package io.engineblock.activities.csv.statements;

import io.engineblock.util.TagFilter;

import java.util.*;
import java.util.stream.Collectors;

public class CSVStmtDocList {

    private List csvStmtDocList = new ArrayList<>();

    public CSVStmtDocList(List csvStmtDocList) {
        this.csvStmtDocList = csvStmtDocList;
    }

    public Map getFilteringDetails(String spec) {
        Map details = new LinkedHashMap<>();
        TagFilter ts = new TagFilter(spec);
        for (CSVStmtDoc gsb : this.csvStmtDocList) {
            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.csvStmtDocList.stream().filter(ts::matchesTagged).collect(Collectors.toList());
    }

    public List getAll() {
        return Collections.unmodifiableList(this.csvStmtDocList);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy