Class Delta

java.lang.Object
io.jenkins.plugins.forensics.delta.Delta
All Implemented Interfaces:
Serializable

public class Delta extends Object implements Serializable
Data class that represents the code difference - so called 'delta' - between two commits.
Author:
Florian Orendi
See Also:
  • Constructor Details

    • Delta

      public Delta(String currentCommit, String referenceCommit, Map<String,FileChanges> fileChangesMap)
      Constructor for a delta instance which wraps code changes between the two passed commits.
      Parameters:
      currentCommit - The currently processed commit
      referenceCommit - The reference commit
      fileChangesMap - The map which contains the changes for modified files, mapped by the file ID.
  • Method Details

    • getCurrentCommit

      public String getCurrentCommit()
    • getReferenceCommit

      public String getReferenceCommit()
    • getFileChangesMap

      public Map<String,FileChanges> getFileChangesMap()
    • getFileChangesById

      public FileChanges getFileChangesById(String fileId)
      Returns information about changes made to the specified file.
      Parameters:
      fileId - the ID of the file
      Returns:
      the information about changes made to the specified file
      Throws:
      NoSuchElementException - if the file ID is not registered
    • addFileChanges

      public void addFileChanges(String fileId, FileChanges fileChange)
      Adds information about changes made to the specified file.

      If there are already information about changes to the specified file, the old information will be overwritten by the new one.

      Parameters:
      fileId - The ID of the file
      fileChange - Information about the made changes
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object