Search in sources :

Example 1 with CheckType

use of org.drools.workbench.services.verifier.api.client.reporting.CheckType in project drools-wb by kiegroup.

the class IssuesSet method mergeIssues.

private Optional<Issue> mergeIssues(final List<Issue> issues, final CheckType typeToMerge) {
    Set<Issue> issuesToMerge = issues.stream().filter(issue -> issue.getCheckType() == typeToMerge).collect(Collectors.toSet());
    Set<Integer> affectedRows = issuesToMerge.stream().flatMap(issue -> issue.getRowNumbers().stream()).sorted().collect(Collectors.toSet());
    return issuesToMerge.stream().findFirst().map(issue -> new Issue(issue.getSeverity(), typeToMerge, affectedRows));
}
Also used : List(java.util.List) ExplanationProvider(org.drools.workbench.services.verifier.api.client.reporting.ExplanationProvider) Issue(org.drools.workbench.services.verifier.api.client.reporting.Issue) Optional(java.util.Optional) Set(java.util.Set) CheckType(org.drools.workbench.services.verifier.api.client.reporting.CheckType) Comparator(java.util.Comparator) Collectors(java.util.stream.Collectors) EnumSet(java.util.EnumSet) TreeSet(java.util.TreeSet) Issue(org.drools.workbench.services.verifier.api.client.reporting.Issue)

Aggregations

Comparator (java.util.Comparator)1 EnumSet (java.util.EnumSet)1 List (java.util.List)1 Optional (java.util.Optional)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 Collectors (java.util.stream.Collectors)1 CheckType (org.drools.workbench.services.verifier.api.client.reporting.CheckType)1 ExplanationProvider (org.drools.workbench.services.verifier.api.client.reporting.ExplanationProvider)1 Issue (org.drools.workbench.services.verifier.api.client.reporting.Issue)1