Class AdvisorRecord
-
- All Implemented Interfaces:
public final class AdvisorRecordA record of a single run of the advisor tool, containing the input and the Vulnerability for every checked package.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAdvisorRecord.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Map<Identifier, List<AdvisorResult>>advisorResultspublic final static AdvisorRecord.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description AdvisorRecord(Map<Identifier, List<AdvisorResult>> advisorResults)
-
Method Summary
Modifier and Type Method Description final Map<Identifier, List<AdvisorResult>>getAdvisorResults()The AdvisorResults for all Packages. final Map<Identifier, Set<Issue>>getIssues()final Map<Identifier, List<Vulnerability>>getVulnerabilities()Return a map of all Packages and the associated Vulnerabilities. final List<Vulnerability>getVulnerabilities(Identifier pkgId)Return a list with all Vulnerability objects that have been found for the given package. final List<Defect>getDefects(Identifier pkgId)Return a list with all Defect objects that have been found for the given package. final Map<Identifier, List<AdvisorResult>>filterResults(Function1<AdvisorResult, Boolean> filter)Apply the given filter to the results stored in this record and return a map with the results that pass the filter. -
-
Constructor Detail
-
AdvisorRecord
AdvisorRecord(Map<Identifier, List<AdvisorResult>> advisorResults)
-
-
Method Detail
-
getAdvisorResults
final Map<Identifier, List<AdvisorResult>> getAdvisorResults()
The AdvisorResults for all Packages.
-
getIssues
final Map<Identifier, Set<Issue>> getIssues()
-
getVulnerabilities
final Map<Identifier, List<Vulnerability>> getVulnerabilities()
Return a map of all Packages and the associated Vulnerabilities.
-
getVulnerabilities
final List<Vulnerability> getVulnerabilities(Identifier pkgId)
Return a list with all Vulnerability objects that have been found for the given package. Results from different advisors are merged if necessary.
-
getDefects
final List<Defect> getDefects(Identifier pkgId)
Return a list with all Defect objects that have been found for the given package. If there are results from different advisors, a union list is constructed. No merging is done, as it is expected that the results from different advisors cannot be combined.
-
filterResults
final Map<Identifier, List<AdvisorResult>> filterResults(Function1<AdvisorResult, Boolean> filter)
Apply the given filter to the results stored in this record and return a map with the results that pass the filter. When processing advisor results, often specific criteria are relevant, e.g. whether security vulnerabilities were found or certain issues were detected. Using this function, it is easy to filter out only those results matching such criteria.
-
-
-
-