Class CommitProcessTime
java.lang.Object
org.variantsync.diffdetective.analysis.CommitProcessTime
Stores the time it took to process a single commit in a given repository in milliseconds.
- Author:
- Paul Bittner
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCommitProcessTime
(String hash, String reponame, long milliseconds) Creates a new CommitProcessTime that stores that the commit the given has in the given repository took the given amount of milliseconds to process. -
Method Summary
Modifier and TypeMethodDescriptionstatic CommitProcessTime
fromString
(String text) Parses aCommitProcessTime
from a string that was produced bytoString()
.hash()
Returns the commit hash.static CommitProcessTime
Creates an invalid count for the given repo.static CommitProcessTime
Computes the maximum of twoCommitProcessTime
s.long
The amount of milliseconds that were required to process this commit.static CommitProcessTime
Computes the minimum of twoCommitProcessTime
s.void
Resets this commit time to the given commit hash and milliseconds.void
Completely resets this commit time.void
set
(CommitProcessTime other) Sets all values of this object to the values of the given time.toString()
static CommitProcessTime
Creates an count for an unkown commit in the given repository.
-
Field Details
-
STR_DELIMITER
- See Also:
-
hash
-
repoName
-
milliseconds
private long milliseconds
-
-
Constructor Details
-
CommitProcessTime
Creates a new CommitProcessTime that stores that the commit the given has in the given repository took the given amount of milliseconds to process.- Parameters:
hash
- The hash of the commit that was processed.reponame
- The name of the repository from which the commit was taken.milliseconds
- The time in milliseconds that were required to process the given commit.
-
-
Method Details
-
Invalid
Creates an invalid count for the given repo. You may want to use this when no commits where analyzed at all.- Parameters:
repoName
- Name of the repository for which to create an invalid commit time.- Returns:
- A commit process time that does not refer to any commit and reports an illegal amount of milliseconds.
-
Unknown
Creates an count for an unkown commit in the given repository. You may want to use this when you need an initial value for a variable.- Parameters:
repoName
- Name of the repository for which to create an unknown commit time.- Returns:
- milliseconds The time in milliseconds that were required to process the unknown commit.
-
set
Resets this commit time to the given commit hash and milliseconds.- Parameters:
hash
- The hash of the commit that was processed.milliseconds
- The time in milliseconds that were required to process the given commit.
-
set
Completely resets this commit time.- Parameters:
hash
- The hash of the commit that was processed.reponame
- The name of the repository from which the commit was taken.milliseconds
- The time in milliseconds that were required to process the given commit.
-
set
Sets all values of this object to the values of the given time. Both objects can be seen as semantically equivalent afterwards.- Parameters:
other
- Other time whose value to copy into this one.
-
hash
Returns the commit hash.- Returns:
- the commit hash.
-
milliseconds
public long milliseconds()The amount of milliseconds that were required to process this commit.- Returns:
- the amount of milliseconds that were required to process this commit.
-
min
Computes the minimum of twoCommitProcessTime
s.- Parameters:
a
- First argument.b
- Second argument.- Returns:
- Minimum of the given two times regarding the
milliseconds()
.
-
max
Computes the maximum of twoCommitProcessTime
s.- Parameters:
a
- First argument.b
- Second argument.- Returns:
- Maximum of the given two times regarding the
milliseconds()
.
-
fromString
Parses aCommitProcessTime
from a string that was produced bytoString()
.- Parameters:
text
- The text to parse to a commit process timeĀ“.- Returns:
- The parsed CommitProcessTime.
- Throws:
AssertionError
- When the input is ill-formed.
-
toString
-