Class GitObject

  • All Implemented Interfaces:
    Direct Known Subclasses:
    Branch, Tag

    public class GitObject
    extends Object
    implements Serializable
    An object in a git repository. Includes the SHA1 and name of the object stored in git (tag, branch, etc.).
    See Also:
    Serialized Form
    • Constructor Detail

      • GitObject

        public GitObject​(String name,
                         org.eclipse.jgit.lib.ObjectId sha1)
        Constructor for GitObject, a named SHA1 (tag, branch, etc.).
        name - String name of this object
        sha1 - ObjectId which uniquely identifies this object
    • Method Detail

      • getSHA1

        public org.eclipse.jgit.lib.ObjectId getSHA1()
        Returns the SHA1 hash of this git object as an ObjectId.
        ObjectId SHA1 of the object.
      • getName

        public String getName()
        Returns the name of this git object (branch name, tag name, etc.).
        String name of the object.
      • getSHA1String

        public String getSHA1String()
        Returns the SHA1 hash of this git object as a String.
        String SHA1 of the object.
      • hashCode

        public int hashCode()
        Returns a hash code value for the object. Considers sha1 and name in the calculation.
        hashCode in class Object
        a hash code value for this object.
      • equals

        public boolean equals​(Object obj)
        Indicates whether some other object is "equal to" this one. Includes sha1 and name in the comparison. Objects of subclasses of this object are not equal to objects of this class, even if they add no fields.
        equals in class Object
        obj - the reference object with which to compare.
        true if this object is the same as the obj argument; false otherwise