Class CompareTemplateOutputHandler.DifferenceDescription
java.lang.Object
org.spdx.utility.compare.CompareTemplateOutputHandler.DifferenceDescription
- Enclosing class:
CompareTemplateOutputHandler
Information about any difference found
- Author:
- Gary O'Neall
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a different descriptionDifferenceDescription(boolean differenceFound, String differenceMessage, List<org.spdx.licenseTemplate.LineColumn> differences) Creates a difference description -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDifference(org.spdx.licenseTemplate.LineColumn location, String token, String msg, String text, org.spdx.licenseTemplate.LicenseTemplateRule rule, CompareTemplateOutputHandler.DifferenceDescription lastOptionalDifference) Adds a new difference to the list of differences found during the comparison processRetrieve the message describing the differences found during the comparison processList<org.spdx.licenseTemplate.LineColumn> booleanCheck whether a difference was found during the comparison processvoidsetDifferenceFound(boolean differenceFound) Set whether a difference was found during the comparison processvoidsetDifferenceMessage(String differenceMessage) Set the message describing the differences found during the comparison process.voidsetDifferences(List<org.spdx.licenseTemplate.LineColumn> differences)
-
Constructor Details
-
DifferenceDescription
public DifferenceDescription(boolean differenceFound, String differenceMessage, List<org.spdx.licenseTemplate.LineColumn> differences) Creates a difference description- Parameters:
differenceFound- if true, a difference was founddifferenceMessage- Message describing the differencesdifferences- list of lines where the difference was found
-
DifferenceDescription
public DifferenceDescription()Creates a different description
-
-
Method Details
-
isDifferenceFound
public boolean isDifferenceFound()Check whether a difference was found during the comparison process- Returns:
trueif a difference was found;falseotherwise.
-
setDifferenceFound
public void setDifferenceFound(boolean differenceFound) Set whether a difference was found during the comparison process- Parameters:
differenceFound-trueif a difference was found;falseotherwise.
-
getDifferenceMessage
Retrieve the message describing the differences found during the comparison processThe difference message provides details about the nature of the differences, including the location, token, and context of the mismatch.
- Returns:
- A message describing the differences.
-
setDifferenceMessage
Set the message describing the differences found during the comparison process.- Parameters:
differenceMessage- A message describing the differences.
-
getDifferences
- Returns:
- list of lines where the difference was found
-
setDifferences
- Parameters:
differences- list of lines where the difference was found
-
addDifference
public void addDifference(org.spdx.licenseTemplate.LineColumn location, String token, String msg, String text, org.spdx.licenseTemplate.LicenseTemplateRule rule, CompareTemplateOutputHandler.DifferenceDescription lastOptionalDifference) Adds a new difference to the list of differences found during the comparison process- Parameters:
location- Location in the text of the differencetoken- Token causing the differencemsg- Message for the differencetext- Template text being compared torule- Template rule where difference was foundlastOptionalDifference- The difference for the last optional difference that failed
-