Class PackageCurationData
-
- All Implemented Interfaces:
public final class PackageCurationDataThis class contains curation data for a package. It is used to amend the automatically detected metadata for a package with corrections. This is required because the metadata provided by a package can be wrong (e.g. outdated VCS data) or incomplete.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringcommentprivate final Stringpurlprivate final Stringcpeprivate final Set<String>authorsprivate final SpdxExpressionconcludedLicenseprivate final Stringdescriptionprivate final StringhomepageUrlprivate final RemoteArtifactbinaryArtifactprivate final RemoteArtifactsourceArtifactprivate final VcsInfoCurationDatavcsprivate final BooleanisMetadataOnlyprivate final BooleanisModifiedprivate final Map<String, SpdxExpression>declaredLicenseMapping
-
Constructor Summary
Constructors Constructor Description PackageCurationData(String comment, String purl, String cpe, Set<String> authors, SpdxExpression concludedLicense, String description, String homepageUrl, RemoteArtifact binaryArtifact, RemoteArtifact sourceArtifact, VcsInfoCurationData vcs, Boolean isMetadataOnly, Boolean isModified, Map<String, SpdxExpression> declaredLicenseMapping)
-
Method Summary
Modifier and Type Method Description final StringgetComment()A plain-text comment about this curation. final StringgetPurl()An additional identifier in package URL syntax. final StringgetCpe()An additional identifier in CPE syntax. final Set<String>getAuthors()The set of authors of the package. final SpdxExpressiongetConcludedLicense()The concluded license as an SpdxExpression. final StringgetDescription()The description of the package, as provided by the package manager. final StringgetHomepageUrl()The homepage of the package. final RemoteArtifactgetBinaryArtifact()The remote artifact where the binary package can be downloaded. final RemoteArtifactgetSourceArtifact()The remote artifact where the source package can be downloaded. final VcsInfoCurationDatagetVcs()VCS-related information. final BooleanisMetadataOnly()Whether the package is metadata only. final BooleanisModified()Whether the package is modified compared to the original source final Map<String, SpdxExpression>getDeclaredLicenseMapping()The declared license mapping entries to be added to the actual declared license mapping, which in turn gets applied by DeclaredLicenseProcessor.process. final CuratedPackageapply(CuratedPackage targetPackage)Apply this PackageCuration to targetPackage by overriding all values of targetPackage with non-null values of this PackageCurationData, and return the resulting CuratedPackage. final PackageCurationDatamerge(PackageCurationData other)Merge with other curation data. -
-
Constructor Detail
-
PackageCurationData
PackageCurationData(String comment, String purl, String cpe, Set<String> authors, SpdxExpression concludedLicense, String description, String homepageUrl, RemoteArtifact binaryArtifact, RemoteArtifact sourceArtifact, VcsInfoCurationData vcs, Boolean isMetadataOnly, Boolean isModified, Map<String, SpdxExpression> declaredLicenseMapping)
-
-
Method Detail
-
getComment
final String getComment()
A plain-text comment about this curation. Should contain information about how and why the curation was created.
-
getPurl
final String getPurl()
An additional identifier in package URL syntax.
-
getCpe
final String getCpe()
An additional identifier in CPE syntax.
-
getAuthors
final Set<String> getAuthors()
The set of authors of the package.
-
getConcludedLicense
final SpdxExpression getConcludedLicense()
The concluded license as an SpdxExpression. It can be used to override the declared / detected licenses of the package.
-
getDescription
final String getDescription()
The description of the package, as provided by the package manager.
-
getHomepageUrl
final String getHomepageUrl()
The homepage of the package.
-
getBinaryArtifact
final RemoteArtifact getBinaryArtifact()
The remote artifact where the binary package can be downloaded.
-
getSourceArtifact
final RemoteArtifact getSourceArtifact()
The remote artifact where the source package can be downloaded.
-
getVcs
final VcsInfoCurationData getVcs()
VCS-related information.
-
isMetadataOnly
final Boolean isMetadataOnly()
Whether the package is metadata only.
-
isModified
final Boolean isModified()
Whether the package is modified compared to the original source
-
getDeclaredLicenseMapping
final Map<String, SpdxExpression> getDeclaredLicenseMapping()
The declared license mapping entries to be added to the actual declared license mapping, which in turn gets applied by DeclaredLicenseProcessor.process.
-
apply
final CuratedPackage apply(CuratedPackage targetPackage)
Apply this PackageCuration to targetPackage by overriding all values of targetPackage with non-null values of this PackageCurationData, and return the resulting CuratedPackage.
-
merge
final PackageCurationData merge(PackageCurationData other)
Merge with other curation data. The
commentproperties are joined but probably need to be adjusted before further processing as their meaning might have been distorted by the merge. For properties that cannot be merged, data in this instance has precedence over data in the other instance.
-
-
-
-