br.com.objectos.git
Class Commit

java.lang.Object
  extended by br.com.objectos.git.Commit
All Implemented Interfaces:
br.com.objectos.core.object.ToStringObject

public final class Commit
extends Object

A Git commit object resulting from a read commit operation.

Since:
1

Method Summary
 boolean equals(Object obj)
          Compares the specified object with this Git object for equality.
 void formatToString(StringBuilder sb, int depth)
           
 Identification getAuthor()
          Returns the author of this commit.
 Identification getCommitter()
          Returns the committer of this commit.
 String getMessage()
          Returns the message of this commit.
 ObjectId getObjectId()
          Returns the hash value that uniquely identifies this Git object.
 br.com.objectos.collections.list.ImmutableList<ObjectId> getParents()
          Returns the hash values of the parents of this commit.
 ObjectId getTree()
          Returns the hash value of the tree object associated to this commit.
 int hashCode()
          Returns the hash code value of this Git object.
 String print()
          Returns a string representation of this commit that should be equivalent to the output of the git-cat-file utility when invoked with the -p option.
 String toString()
          Returns the string representation of this Git object as defined by the ToStringObject.formatToString(StringBuilder, int) method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

formatToString

public final void formatToString(StringBuilder sb,
                                 int depth)

getAuthor

public final Identification getAuthor()
Returns the author of this commit.

Returns:
the author of this commit

getCommitter

public final Identification getCommitter()
Returns the committer of this commit.

Returns:
the committer of this commit

getMessage

public final String getMessage()
Returns the message of this commit.

Returns:
the message of this commit

getParents

public final br.com.objectos.collections.list.ImmutableList<ObjectId> getParents()
Returns the hash values of the parents of this commit.

Returns:
the hash values of the parents of this commit

getTree

public final ObjectId getTree()
Returns the hash value of the tree object associated to this commit.

Returns:
the hash value of the tree object associated to this commit

print

public final String print()
Returns a string representation of this commit that should be equivalent to the output of the git-cat-file utility when invoked with the -p option.

Returns:
a string representation of this commit
Since:
3

equals

public final boolean equals(Object obj)
Compares the specified object with this Git object for equality.

Returns true if and only if the specified object is also a Git object of the same type and if both instances have the same hash value.

Overrides:
equals in class Object
Parameters:
obj - the object to be compared for equality with this Git object
Returns:
true if the specified object is equal to this Git object

getObjectId

public final ObjectId getObjectId()
Returns the hash value that uniquely identifies this Git object.

Returns:
the hash value that uniquely identifies this Git object

hashCode

public final int hashCode()
Returns the hash code value of this Git object.

Overrides:
hashCode in class Object
Returns:
the hash code value of this Git object

toString

public final String toString()
Returns the string representation of this Git object as defined by the ToStringObject.formatToString(StringBuilder, int) method.

Overrides:
toString in class Object
Returns:
the string representation of this Git object


Copyright © 2020–2022 Objectos Software LTDA. All rights reserved.