Package org.spdx.utility.compare
Class SpdxPackageComparer
java.lang.Object
org.spdx.utility.compare.SpdxItemComparer
org.spdx.utility.compare.SpdxPackageComparer
public class SpdxPackageComparer extends SpdxItemComparer
Compares two SPDX package. The
compare(pkgA, pkgB) method will perform the comparison and
store the results. isDifferenceFound() will return true of any
differences were found.- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.utility.compare.SpdxItemComparer
documentItem, extractedLicenseIdMap, name -
Constructor Summary
Constructors Constructor Description SpdxPackageComparer(Map<SpdxDocument,Map<SpdxDocument,Map<String,String>>> extractedLicenseIdMap) -
Method Summary
Methods inherited from class org.spdx.utility.compare.SpdxItemComparer
addDocumentItem, checkCompareMade, getItem, getUniqueAnnotations, getUniqueRelationship, getUniqueSeenLicenses, isAnnotationsEquals, isAttributionTextEquals, isCommentsEquals, isConcludedLicenseEquals, isCopyrightsEquals, isLicenseCommmentsEquals, isRelationshipsEquals, isSeenLicenseEquals
-
Constructor Details
-
SpdxPackageComparer
public SpdxPackageComparer(Map<SpdxDocument,Map<SpdxDocument,Map<String,String>>> extractedLicenseIdMap)- Parameters:
extractedLicenseIdMap- map of all extracted license IDs for any SPDX documents to be added to the comparer
-
-
Method Details
-
addDocumentPackage
public void addDocumentPackage(SpdxDocument spdxDocument, SpdxPackage spdxPackage) throws SpdxCompareException, InvalidSPDXAnalysisExceptionAdd a package to the comparer and performs the comparison to any existing documents- Parameters:
spdxDocument- document containing the packagespdxPackage- packaged to be added- Throws:
SpdxCompareExceptionInvalidSPDXAnalysisException
-
isInProgress
public boolean isInProgress()- Overrides:
isInProgressin classSpdxItemComparer- Returns:
- the inProgress
-
isDifferenceFound
- Overrides:
isDifferenceFoundin classSpdxItemComparer- Returns:
- the differenceFound
- Throws:
SpdxCompareException
-
checkInProgress
checks to make sure there is not a compare in progress- Overrides:
checkInProgressin classSpdxItemComparer- Throws:
SpdxCompareException
-
isPackageVersionsEquals
- Returns:
- the packageVersionsEquals
- Throws:
SpdxCompareException
-
isPackageFilenamesEquals
- Returns:
- the packageFilenamesEquals
- Throws:
SpdxCompareException
-
isPackageSuppliersEquals
- Returns:
- the packageSuppliersEquals
- Throws:
SpdxCompareException
-
isPackageDownloadLocationsEquals
- Returns:
- the packageDownloadLocationsEquals
- Throws:
SpdxCompareException
-
isPackageVerificationCodesEquals
- Returns:
- the packageVerificationCodeesEquals
- Throws:
SpdxCompareException
-
isFilesAnalyzedEquals
- Returns:
- the filesAnalyzedEquals
- Throws:
SpdxCompareException
-
isPackageChecksumsEquals
- Returns:
- the packageChecksumsEquals
- Throws:
SpdxCompareException
-
isPackageSourceInfosEquals
- Returns:
- the packageSourceInfosEquals
- Throws:
SpdxCompareException
-
isDeclaredLicensesEquals
- Returns:
- the declaredLicensesEquals
- Throws:
SpdxCompareException
-
isPackageSummaryEquals
- Returns:
- the packageSummaryEquals
- Throws:
SpdxCompareException
-
isPackageDescriptionsEquals
- Returns:
- the packageDescriptionsEquals
- Throws:
SpdxCompareException
-
isPackageOriginatorsEqual
- Returns:
- the packageOriginatorsEqual
- Throws:
SpdxCompareException
-
isPackageHomePagesEquals
- Returns:
- the packageHomePagesEquals
- Throws:
SpdxCompareException
-
isExternalRefsEquals
- Returns:
- the externalRefsEquals
- Throws:
SpdxCompareException
-
getDocPackage
Return the package associated with the document- Parameters:
document-- Returns:
- The document associated with the document
- Throws:
SpdxCompareException
-
getUniqueChecksums
public List<Checksum> getUniqueChecksums(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareExceptionGet the checksums which are present in document A but not in document B- Returns:
- the uniqueChecksums
- Throws:
SpdxCompareException
-
getUniqueExternalRefs
public List<ExternalRef> getUniqueExternalRefs(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareException- Throws:
SpdxCompareException
-
getExternalRefDifferences
public List<SpdxExternalRefDifference> getExternalRefDifferences(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareException- Throws:
SpdxCompareException
-
isPackageFilesEquals
- Returns:
- the packageFilesEquals
- Throws:
SpdxCompareException
-
getFileDifferences
public List<SpdxFileDifference> getFileDifferences(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareExceptionGet any fileDifferences which are in docA but not in docB- Parameters:
docA-docB-- Returns:
- Throws:
SpdxCompareException
-
getUniqueFiles
public List<SpdxFile> getUniqueFiles(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareExceptionReturn any unique files by name which are in docA but not in docB- Parameters:
docA-docB-- Returns:
- Throws:
SpdxCompareException
-
getPackageName
- Returns:
- Throws:
SpdxCompareException
-
getNumPackages
- Returns:
- Throws:
SpdxCompareException
-