Klasse CommitDiffItem

java.lang.Object
io.jenkins.plugins.forensics.miner.CommitDiffItem
Alle implementierten Schnittstellen:
Serializable

public class CommitDiffItem extends Object implements Serializable
Represents all changes related to a specific file in a given SCM commit (diff). For each commit the number of added and deleted lines will be recorded. Since a commit consists of a list of differences the number of added or deleted lines can be updated several times until the final size has been reached.
Autor:
Ullrich Hafner
Siehe auch:
  • Konstruktordetails

    • CommitDiffItem

      public CommitDiffItem(String id, String author, int time)
      Creates a new CommitDiffItem.
      Parameter:
      id - commit ID
      author - author of the commit
      time - the time of the commit (given as number of seconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT)
    • CommitDiffItem

      public CommitDiffItem(CommitDiffItem copy)
      Creates a new copy of the specified CommitDiffItem. Note that the number of added and deleted lines will be set to zero, so this constructor is not a copy constructor in the common sense.
      Parameter:
      copy - the commit to copy the base properties from
  • Methodendetails

    • readResolve

      protected Object readResolve()
      Called after deserialization to improve the memory usage.
      Gibt zurück:
      this
    • getId

      public String getId()
    • getAuthor

      public String getAuthor()
    • getTime

      public int getTime()
    • getTotalAddedLines

      public int getTotalAddedLines()
    • getTotalDeletedLines

      public int getTotalDeletedLines()
    • getOldPath

      public String getOldPath()
    • isDelete

      public boolean isDelete()
    • isMove

      public boolean isMove()
    • getNewPath

      public String getNewPath()
    • addLines

      public CommitDiffItem addLines(int addedLines)
      Adds a diff with the specified number of added lines to this commit.
      Parameter:
      addedLines - the additional number of added lines
      Gibt zurück:
      this
    • deleteLines

      public CommitDiffItem deleteLines(int deletedLines)
      Adds a diff with the specified number of deleted lines to this commit.
      Parameter:
      deletedLines - the additional number of deleted lines
      Gibt zurück:
      this
    • setOldPath

      public CommitDiffItem setOldPath(edu.hm.hafner.util.TreeString oldPath)
      Sets the old path of a moved or deleted file. If a file has been moved then the newPath contains the new file name while the oldPath contains the old file name. It a file has been deleted, then the newPath should be set to NO_FILE_NAME while the oldPath contains the name of the deleted file.
      Parameter:
      oldPath - the path of the modified path
      Gibt zurück:
      this
    • setNewPath

      public CommitDiffItem setNewPath(edu.hm.hafner.util.TreeString newPath)
      Sets the path of the modified file. If a file has been moved then the newPath contains the new file name while the oldPath contains the old file name. It a file has been deleted, then the newPath should be set to NO_FILE_NAME while the oldPath contains the name of the deleted file.
      Parameter:
      newPath - the path of the modified path
      Gibt zurück:
      this
    • equals

      public boolean equals(Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object