Class Commit

java.lang.Object
com.mooltiverse.oss.nyx.entities.git.Commit
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Commit>

public class Commit extends Object implements Comparable<Commit>, Cloneable, Serializable
This object is a Git commit value holder independent from the underlying Git implementation.
See Also:
  • Constructor Details

    • Commit

      public Commit(String sha, int date, List<String> parents, Action authorAction, Action commitAction, Message message, Set<Tag> tags)
      Constructor.
      Parameters:
      sha - the commit SHA-1 identifier. Cannot be null
      date - the commit date
      parents - the SHA-1 identifiers of parent commits. If the commit has no parents an empty, non null list, must be passed
      authorAction - the value holder about the author. Cannot be null
      commitAction - the value holder about the committer. Cannot be null
      message - the commit message. Cannot be null
      tags - the tags applied to this commit. If the commit has no tags an empty, non null set, must be passed
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Commit c)
      Specified by:
      compareTo in interface Comparable<Commit>
    • getAuthorAction

      public Action getAuthorAction()
      Returns the author data.
      Returns:
      the author data. Never null.
    • getCommitAction

      public Action getCommitAction()
      Returns the committer data.
      Returns:
      the committer data. Never null.
    • getDate

      public int getDate()
      Returns the commit date.
      Returns:
      the commit date.
    • getMessage

      public Message getMessage()
      Returns the commit message.
      Returns:
      the commit message. Never null.
    • getParents

      public List<String> getParents()
      Returns the immutable list of parent commit SHA-1 identifiers.
      Returns:
      the immutable list of parent commit SHA-1 identifiers. May be empty but not null.
    • getTags

      public Set<Tag> getTags()
      Returns the immutable list of tags pointing to this commit.
      Returns:
      the immutable list of tags pointing to this commit. May be empty but not null.
    • getSHA

      public String getSHA()
      Returns the SHA-1 identifier for the commit.
      Returns:
      the SHA-1 identifier for the commit. Never null.
    • toString

      public String toString()
      Overrides:
      toString in class Object