Class Revision

java.lang.Object
hudson.plugins.git.Revision
All Implemented Interfaces:
Serializable, Cloneable

@ExportedBean(defaultVisibility=999) public class Revision extends Object implements Serializable, Cloneable
SHA1 in the object tree and the collection of branches that share this SHA1. Unlike other SCMs, git can have >1 branches point at the _same_ commit.
See Also:
  • Constructor Details

    • Revision

      public Revision(org.eclipse.jgit.lib.ObjectId sha1)
      Constructor for Revision.
      Parameters:
      sha1 - a ObjectId object.
    • Revision

      public Revision(org.eclipse.jgit.lib.ObjectId sha1, Collection<Branch> branches)
      Constructor for Revision.
      Parameters:
      sha1 - a ObjectId object.
      branches - a Collection object.
  • Method Details

    • getSha1

      public org.eclipse.jgit.lib.ObjectId getSha1()
      Getter for the field sha1.
      Returns:
      a ObjectId object.
    • getSha1String

      @Exported(name="SHA1") public String getSha1String()
      getSha1String.
      Returns:
      a String object.
    • setSha1

      public void setSha1(org.eclipse.jgit.lib.ObjectId sha1)
      Setter for the field sha1.
      Parameters:
      sha1 - a ObjectId object.
    • getBranches

      @Exported(name="branch") public Collection<Branch> getBranches()
      Getter for the field branches.
      Returns:
      a Collection object.
    • setBranches

      public void setBranches(Collection<Branch> branches)
      Setter for the field branches.
      Parameters:
      branches - a Collection object.
    • containsBranchName

      public boolean containsBranchName(String name)
      Returns whether the revision contains the specified branch.
      Parameters:
      name - the name of the branch
      Returns:
      whether the revision contains the branch
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Revision clone()
      Overrides:
      clone in class Object
    • hashCode

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

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