Package org.spdx.tools.compare
Class CompareHelper
java.lang.Object
org.spdx.tools.compare.CompareHelper
public class CompareHelper extends Object
Helper class for comparisons
- Author:
- Gary O'Neall
-
Method Summary
Modifier and Type Method Description static StringannotationsToString(Collection<org.spdx.library.model.Annotation> annotations)static StringannotationToString(org.spdx.library.model.Annotation annotation)static StringattributionsToString(Collection<String> attributions)static StringchecksumsToString(Collection<org.spdx.library.model.Checksum> checksums)Create a string from an array of checksumsstatic StringchecksumToString(Optional<org.spdx.library.model.Checksum> checksum)static StringchecksumToString(org.spdx.library.model.Checksum checksum)static booleanequivalent(Collection<? extends org.spdx.library.model.ModelObject> collection1, Collection<? extends org.spdx.library.model.ModelObject> collection2)static booleanequivalent(Optional<? extends org.spdx.library.model.ModelObject> c1, Optional<? extends org.spdx.library.model.ModelObject> c2)static StringexternalRefsToString(Collection<org.spdx.library.model.ExternalRef> externalRefs, String docNamespace)Convert external refs to a friendly stringstatic StringexternalRefToString(org.spdx.library.model.ExternalRef externalRef, String docNamespace)Convert a single external ref to a friendly stringstatic StringfileTypesToString(org.spdx.library.model.enumerations.FileType[] fileTypes)static StringformatSpdxElementList(Collection<org.spdx.library.model.SpdxElement> elements)static StringlicenseInfosToString(Collection<org.spdx.library.model.license.AnyLicenseInfo> licenseInfos)static StringrelationshipsToString(Collection<org.spdx.library.model.Relationship> relationships)static StringrelationshipToString(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.InvalidSPDXAnalysisExceptionCreate 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.InvalidSPDXAnalysisExceptionConvert 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.InvalidSPDXAnalysisExceptionConvert 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
-