Search in sources :

Example 1 with CheckType

use of org.drools.verifier.api.reporting.CheckType in project kie-wb-common 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) CheckType(org.drools.verifier.api.reporting.CheckType) ExplanationProvider(org.kie.workbench.common.services.verifier.reporting.client.reporting.ExplanationProvider) Optional(java.util.Optional) Set(java.util.Set) Issue(org.drools.verifier.api.reporting.Issue) Comparator(java.util.Comparator) Collectors(java.util.stream.Collectors) EnumSet(java.util.EnumSet) TreeSet(java.util.TreeSet) Issue(org.drools.verifier.api.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.verifier.api.reporting.CheckType)1 Issue (org.drools.verifier.api.reporting.Issue)1 ExplanationProvider (org.kie.workbench.common.services.verifier.reporting.client.reporting.ExplanationProvider)1