Package org.spdx.tools.compare
Class CompareHelper
java.lang.Object
org.spdx.tools.compare.CompareHelper
Helper class for comparisons
- Author:
- Gary O'Neall
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
annotationsToString
(Collection<org.spdx.library.model.Annotation> annotations) static String
annotationToString
(org.spdx.library.model.Annotation annotation) static String
attributionsToString
(Collection<String> attributions) static String
checksumsToString
(Collection<org.spdx.library.model.Checksum> checksums) Create a string from an array of checksumsstatic String
checksumToString
(Optional<org.spdx.library.model.Checksum> checksum) static String
checksumToString
(org.spdx.library.model.Checksum checksum) static boolean
equivalent
(Collection<? extends org.spdx.library.model.ModelObject> collection1, Collection<? extends org.spdx.library.model.ModelObject> collection2) static boolean
equivalent
(Optional<? extends org.spdx.library.model.ModelObject> c1, Optional<? extends org.spdx.library.model.ModelObject> c2) static String
externalRefsToString
(Collection<org.spdx.library.model.ExternalRef> externalRefs, String docNamespace) Convert external refs to a friendly stringstatic String
externalRefToString
(org.spdx.library.model.ExternalRef externalRef, String docNamespace) Convert a single external ref to a friendly stringstatic String
fileTypesToString
(org.spdx.library.model.enumerations.FileType[] fileTypes) static String
formatSpdxElementList
(Collection<org.spdx.library.model.SpdxElement> elements) static String
licenseInfosToString
(Collection<org.spdx.library.model.license.AnyLicenseInfo> licenseInfos) static String
relationshipsToString
(Collection<org.spdx.library.model.Relationship> relationships) static String
relationshipToString
(org.spdx.library.model.Relationship relationship)
-
Method Details
-
annotationToString
public static String annotationToString(org.spdx.library.model.Annotation annotation) throws org.spdx.library.InvalidSPDXAnalysisException - Parameters:
annotation
-- Returns:
- Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
checksumsToString
public static String checksumsToString(Collection<org.spdx.library.model.Checksum> checksums) throws org.spdx.library.InvalidSPDXAnalysisException Create a string from an array of checksums- Parameters:
checksums
-- Returns:
- Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
checksumToString
public static String checksumToString(org.spdx.library.model.Checksum checksum) throws org.spdx.library.InvalidSPDXAnalysisException - Parameters:
checksum
-- Returns:
- Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
licenseInfosToString
public static String licenseInfosToString(Collection<org.spdx.library.model.license.AnyLicenseInfo> licenseInfos) - Parameters:
licenseInfos
-- Returns:
-
annotationsToString
public static String annotationsToString(Collection<org.spdx.library.model.Annotation> annotations) throws org.spdx.library.InvalidSPDXAnalysisException - Parameters:
annotations
-- Returns:
- Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
attributionsToString
-
relationshipToString
public static String relationshipToString(org.spdx.library.model.Relationship relationship) throws org.spdx.library.InvalidSPDXAnalysisException - Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
relationshipsToString
public static String relationshipsToString(Collection<org.spdx.library.model.Relationship> relationships) throws org.spdx.library.InvalidSPDXAnalysisException - Parameters:
relationships
-- Returns:
- Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
formatSpdxElementList
public static String formatSpdxElementList(Collection<org.spdx.library.model.SpdxElement> elements) throws org.spdx.library.InvalidSPDXAnalysisException - Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
fileTypesToString
- Parameters:
fileTypes
-- Returns:
-
externalRefsToString
public static String externalRefsToString(Collection<org.spdx.library.model.ExternalRef> externalRefs, String docNamespace) throws org.spdx.library.InvalidSPDXAnalysisException Convert external refs to a friendly string- Parameters:
externalRefs
-- Returns:
- Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
externalRefToString
public static String externalRefToString(org.spdx.library.model.ExternalRef externalRef, String docNamespace) throws org.spdx.library.InvalidSPDXAnalysisException Convert a single external ref to a friendly string- Parameters:
externalRef
-docNamespace
-- Returns:
- Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
checksumToString
public static String checksumToString(Optional<org.spdx.library.model.Checksum> checksum) throws org.spdx.library.InvalidSPDXAnalysisException - Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
equivalent
public static boolean equivalent(Optional<? extends org.spdx.library.model.ModelObject> c1, Optional<? extends org.spdx.library.model.ModelObject> c2) throws org.spdx.library.InvalidSPDXAnalysisException - Throws:
org.spdx.library.InvalidSPDXAnalysisException
-
equivalent
public static boolean equivalent(Collection<? extends org.spdx.library.model.ModelObject> collection1, Collection<? extends org.spdx.library.model.ModelObject> collection2) throws org.spdx.library.InvalidSPDXAnalysisException - Throws:
org.spdx.library.InvalidSPDXAnalysisException
-