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
Author:
Gary O'Neall
  • 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 found
      differenceMessage - Message describing the differences
      differences - 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:
      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 process

      The 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 difference
      token - Token causing the difference
      msg - Message for the difference
      text - Template text being compared to
      rule - Template rule where difference was found
      lastOptionalDifference - The difference for the last optional difference that failed