Class FindingCurationMatcher
-
- All Implemented Interfaces:
public final class FindingCurationMatcherA class for matching and applying LicenseFindingCurations to LicenseFindings.
-
-
Constructor Summary
Constructors Constructor Description FindingCurationMatcher()
-
Method Summary
Modifier and Type Method Description final Booleanmatches(LicenseFinding finding, LicenseFindingCuration curation, String relativeFindingPath)Return true if and only if the given curation is applicable to the given finding. final LicenseFindingapply(LicenseFinding finding, LicenseFindingCuration curation, String relativeFindingPath)Return the curated finding if the given curation is applicable to the given finding or the given finding otherwise. final List<LicenseFindingCurationResult>applyAll(Collection<LicenseFinding> findings, Collection<LicenseFindingCuration> curations, String relativeFindingsPath)Applies the given curations to the given findings. -
-
Method Detail
-
matches
final Boolean matches(LicenseFinding finding, LicenseFindingCuration curation, String relativeFindingPath)
Return true if and only if the given curation is applicable to the given finding. The relativeFindingPath path is the path from the directory the curation is relative to, to the directory the finding is relative to.
-
apply
final LicenseFinding apply(LicenseFinding finding, LicenseFindingCuration curation, String relativeFindingPath)
Return the curated finding if the given curation is applicable to the given finding or the given finding otherwise. Null is returned if and only if the given curation is applicable and its concluded license equals SpdxConstants.NONE. If the finding is relative to a subdirectory of the path that the curations are relative to, this needs to be set in the relativeFindingPath.
-
applyAll
final List<LicenseFindingCurationResult> applyAll(Collection<LicenseFinding> findings, Collection<LicenseFindingCuration> curations, String relativeFindingsPath)
Applies the given curations to the given findings. In case multiple curations match any given finding all curations are applied to the original finding, thus in this case there are multiple curated findings for one finding. If multiple curations lead to the same result, only one of them is contained in the returned map. If the findings are relative to a subdirectory of the path that the curations are relative to, this needs to be set in the relativeFindingsPath.
-
-
-
-