Package org.ossreviewtoolkit.model
Class Snippet
-
- All Implemented Interfaces:
public final class Snippet
-
-
Field Summary
Fields Modifier and Type Field Description private final Floatscoreprivate final TextLocationlocationprivate final KnownProvenanceprovenanceprivate final Stringpurlprivate final SpdxExpressionlicensesprivate final Map<String, String>additionalData
-
Constructor Summary
Constructors Constructor Description Snippet(Float score, TextLocation location, KnownProvenance provenance, String purl, SpdxExpression licenses, Map<String, String> additionalData)
-
Method Summary
Modifier and Type Method Description final FloatgetScore()The matching score between the code being scanned and the code snippet. final TextLocationgetLocation()The text location in the snippet that has matched. final KnownProvenancegetProvenance()The provenance of the snippet, either an artifact or a repository. final StringgetPurl()The purl representing the author/vendor, artifact, version of the code snippet. final SpdxExpressiongetLicenses()The license of the component the code snippet is commit from. final Map<String, String>getAdditionalData()A map for scanner specific snippet data that cannot be mapped into any generalized property, but still needs to be made available in the scan summary. -
-
Constructor Detail
-
Snippet
Snippet(Float score, TextLocation location, KnownProvenance provenance, String purl, SpdxExpression licenses, Map<String, String> additionalData)
-
-
Method Detail
-
getScore
final Float getScore()
The matching score between the code being scanned and the code snippet. This is scanner specific (e.g. for ScanOSS this is a percentage).
-
getLocation
final TextLocation getLocation()
The text location in the snippet that has matched.
-
getProvenance
final KnownProvenance getProvenance()
The provenance of the snippet, either an artifact or a repository.
-
getPurl
final String getPurl()
The purl representing the author/vendor, artifact, version of the code snippet. If the snippet scanner does not natively support purls, it will be generated by ORT.
-
getLicenses
final SpdxExpression getLicenses()
The license of the component the code snippet is commit from.
-
getAdditionalData
final Map<String, String> getAdditionalData()
A map for scanner specific snippet data that cannot be mapped into any generalized property, but still needs to be made available in the scan summary.
-
-
-
-