Class JGitCommit

  • All Implemented Interfaces:
    GitCommit

    class JGitCommit
    extends Object
    implements GitCommit
    Wrapper around JGit's RevCommit object to represent a Git commit
    Author:
    Sebastian Staudt
    • Constructor Detail

      • JGitCommit

        JGitCommit​(RevCommit commit)
        Creates a new instance from a JGit commit object
        Parameters:
        commit - The commit object to wrap
    • Method Detail

      • equals

        public boolean equals​(Object object)
        Compare an object to this one commit

        An object is equal to this commit object if it is an instance of JGitCommit and wraps around the same JGit commit object.

        Overrides:
        equals in class Object
        Parameters:
        object - The object to check for equality
        Returns:
        true if the object is equal to this one
      • getAuthorDate

        public Date getAuthorDate()
        Description copied from interface: GitCommit
        Returns the date when this commit has been authored
        Specified by:
        getAuthorDate in interface GitCommit
        Returns:
        The author date of this commit
      • getAuthorEmailAddress

        public String getAuthorEmailAddress()
        Description copied from interface: GitCommit
        Returns the email address of the author of this commit
        Specified by:
        getAuthorEmailAddress in interface GitCommit
        Returns:
        The commit author's email address
      • getAuthorName

        public String getAuthorName()
        Description copied from interface: GitCommit
        Returns the name of the author of this commit
        Specified by:
        getAuthorName in interface GitCommit
        Returns:
        The commit author's name
      • getAuthorTimeZone

        public TimeZone getAuthorTimeZone()
        Description copied from interface: GitCommit
        Returns the timezone in which this commit has been authored
        Specified by:
        getAuthorTimeZone in interface GitCommit
        Returns:
        The author timezone of this commit
      • getCommitterDate

        public Date getCommitterDate()
        Description copied from interface: GitCommit
        Returns the date when this commit has been committed
        Specified by:
        getCommitterDate in interface GitCommit
        Returns:
        The committer date of this commit
      • getCommitterEmailAddress

        public String getCommitterEmailAddress()
        Description copied from interface: GitCommit
        Returns the email address of the committer
        Specified by:
        getCommitterEmailAddress in interface GitCommit
        Returns:
        The committer's email address
      • getCommitterName

        public String getCommitterName()
        Description copied from interface: GitCommit
        Returns the name of the committer
        Specified by:
        getCommitterName in interface GitCommit
        Returns:
        The committer's name
      • getCommitterTimeZone

        public TimeZone getCommitterTimeZone()
        Description copied from interface: GitCommit
        Returns the timezone in which this commit has been committed
        Specified by:
        getCommitterTimeZone in interface GitCommit
        Returns:
        The committer timezone of this commit
      • getId

        public String getId()
        Description copied from interface: GitCommit
        Returns the SHA hash ID of this commit
        Specified by:
        getId in interface GitCommit
        Returns:
        The SHA ID of this commit
      • getMessage

        public String getMessage()
        Description copied from interface: GitCommit
        Returns the message of this commit
        Specified by:
        getMessage in interface GitCommit
        Returns:
        The message of this commit
      • getMessageSubject

        public String getMessageSubject()
        Description copied from interface: GitCommit
        Returns the subject of the commit's message

        The message subject is the first line of the commit message.

        Specified by:
        getMessageSubject in interface GitCommit
        Returns:
        The message subject of this commit
      • hashCode

        public int hashCode()
        Returns the hash code of the underlying commit's ID string
        Overrides:
        hashCode in class Object
        Returns:
        The hash code for this commit
      • isMergeCommit

        public boolean isMergeCommit()
        Specified by:
        isMergeCommit in interface GitCommit
        Returns:
        true if this commit is a merge commit