Klasse CommitDiffItem
java.lang.Object
io.jenkins.plugins.forensics.miner.CommitDiffItem
- Alle implementierten Schnittstellen:
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:
-
Konstruktorübersicht
KonstruktorBeschreibungCommitDiffItem
(CommitDiffItem copy) Creates a new copy of the specifiedCommitDiffItem
.CommitDiffItem
(String id, String author, int time) Creates a newCommitDiffItem
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungaddLines
(int addedLines) Adds a diff with the specified number of added lines to this commit.deleteLines
(int deletedLines) Adds a diff with the specified number of deleted lines to this commit.boolean
getId()
int
getTime()
int
int
int
hashCode()
boolean
isDelete()
boolean
isMove()
protected Object
Called after de-serialization to improve the memory usage.setNewPath
(edu.hm.hafner.util.TreeString newPath) Sets the path of the modified file.setOldPath
(edu.hm.hafner.util.TreeString oldPath) Sets the old path of a moved or deleted file.toString()
-
Konstruktordetails
-
CommitDiffItem
Creates a newCommitDiffItem
.- Parameter:
id
- commit IDauthor
- author of the committime
- 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
Creates a new copy of the specifiedCommitDiffItem
. 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
Called after de-serialization to improve the memory usage.- Gibt zurück:
- this
-
getId
-
getAuthor
-
getTime
public int getTime() -
getTotalAddedLines
public int getTotalAddedLines() -
getTotalDeletedLines
public int getTotalDeletedLines() -
getOldPath
-
isDelete
public boolean isDelete() -
isMove
public boolean isMove() -
getNewPath
-
addLines
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
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
Sets the old path of a moved or deleted file. If a file has been moved then thenewPath
contains the new file name while theoldPath
contains the old file name. It a file has been deleted, then thenewPath
should be set toNO_FILE_NAME
while theoldPath
contains the name of the deleted file.- Parameter:
oldPath
- the path of the modified path- Gibt zurück:
- this
-
setNewPath
Sets the path of the modified file. If a file has been moved then thenewPath
contains the new file name while theoldPath
contains the old file name. It a file has been deleted, then thenewPath
should be set toNO_FILE_NAME
while theoldPath
contains the name of the deleted file.- Parameter:
newPath
- the path of the modified path- Gibt zurück:
- this
-
equals
-
hashCode
public int hashCode() -
toString
-