Package org.spdx.utility.compare
Class CompareTemplateOutputHandler.DifferenceDescription
- java.lang.Object
-
- org.spdx.utility.compare.CompareTemplateOutputHandler.DifferenceDescription
-
- Enclosing class:
- CompareTemplateOutputHandler
public static class CompareTemplateOutputHandler.DifferenceDescription extends Object
Information about any difference found
-
-
Constructor Summary
Constructors Constructor Description DifferenceDescription()
Creates a different descriptionDifferenceDescription(boolean differenceFound, String differenceMessage, List<org.spdx.licenseTemplate.LineColumn> differences)
Creates a difference description
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 processString
getDifferenceMessage()
Retrieve the message describing the differences found during the comparison processList<org.spdx.licenseTemplate.LineColumn>
getDifferences()
boolean
isDifferenceFound()
Check whether a difference was found during the comparison processvoid
setDifferenceFound(boolean differenceFound)
Set whether a difference was found during the comparison processvoid
setDifferenceMessage(String differenceMessage)
Set the message describing the differences found during the comparison process.void
setDifferences(List<org.spdx.licenseTemplate.LineColumn> differences)
-
-
-
Constructor Detail
-
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 Detail
-
isDifferenceFound
public boolean isDifferenceFound()
Check whether a difference was found during the comparison process- Returns:
true
if a difference was found;false
otherwise.
-
setDifferenceFound
public void setDifferenceFound(boolean differenceFound)
Set whether a difference was found during the comparison process- Parameters:
differenceFound
-true
if a difference was found;false
otherwise.
-
getDifferenceMessage
public String 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
public void setDifferenceMessage(String differenceMessage)
Set the message describing the differences found during the comparison process.- Parameters:
differenceMessage
- A message describing the differences.
-
getDifferences
public List<org.spdx.licenseTemplate.LineColumn> getDifferences()
- Returns:
- list of lines where the difference was found
-
setDifferences
public void setDifferences(List<org.spdx.licenseTemplate.LineColumn> differences)
- 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
-
-