Class FileBlame

java.lang.Object
io.jenkins.plugins.forensics.blame.FileBlame
All Implemented Interfaces:
Serializable, Iterable<Integer>

public final class FileBlame extends Object implements Iterable<Integer>, Serializable
Stores the repository blames for several lines of a single file. File names are stored using the absolute path of the file.
Author:
Ullrich Hafner
See Also:
  • Method Details

    • getFileName

      public String getFileName()
    • getLines

      public Set<Integer> getLines()
    • iterator

      @NonNull public Iterator<Integer> iterator()
      Specified by:
      iterator in interface Iterable<Integer>
    • setCommit

      public void setCommit(int lineNumber, String id)
      Sets the commit ID for the specified line number.
      Parameters:
      lineNumber - the line number
      id - the commit ID
    • getCommit

      public String getCommit(int line)
      Returns the commit ID for the specified line.
      Parameters:
      line - the affected line
      Returns:
      the commit ID
    • setName

      public void setName(int lineNumber, String name)
      Sets the author name for the specified line number.
      Parameters:
      lineNumber - the line number
      name - the author name
    • getName

      public String getName(int line)
      Returns the author name for the specified line.
      Parameters:
      line - the affected line
      Returns:
      the author name
    • setEmail

      public void setEmail(int lineNumber, String emailAddress)
      Sets the email address for the specified line number.
      Parameters:
      lineNumber - the line number
      emailAddress - the email address of the author
    • getEmail

      public String getEmail(int line)
      Returns the author email for the specified line.
      Parameters:
      line - the affected line
      Returns:
      the author email
    • setTime

      public void setTime(int lineNumber, int time)
      Sets the modification time for the specified line. Essentially, this is the time of the last commit that changed this line.
      Parameters:
      lineNumber - the line number
      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).
    • getTime

      public int getTime(int line)
      Returns the modification time for the specified line. Essentially, this is the time of the last commit that changed this line.
      Parameters:
      line - the affected line
      Returns:
      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.).
    • merge

      public void merge(FileBlame other)
      Merges the additional lines of the other FileBlame instance with the lines of this instance.
      Parameters:
      other - the other blames
      Throws:
      IllegalArgumentException - if the file name of the other instance does not match
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object