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:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Commit c)booleanequals(Object obj)ActiongetAuthorAction()Returns the author data.ActiongetCommitAction()Returns the committer data.intgetDate()Returns the commit date.MessagegetMessage()Returns the commit message.List<String>getParents()Returns the immutable list of parent commit SHA-1 identifiers.StringgetSHA()Returns the SHA-1 identifier for the commit.Set<Tag>getTags()Returns the immutable list of tags pointing to this commit.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
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 benulldate- the commit dateparents- the SHA-1 identifiers of parent commits. If the commit has no parents an empty, nonnulllist, must be passedauthorAction- the value holder about the author. Cannot benullcommitAction- the value holder about the committer. Cannot benullmessage- the commit message. Cannot benulltags- the tags applied to this commit. If the commit has no tags an empty, nonnullset, must be passed
-
-
Method Detail
-
compareTo
public int compareTo(Commit c)
- Specified by:
compareToin interfaceComparable<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.
-
-