Package org.kohsuke.github
Class GHCommitBuilder
- java.lang.Object
-
- org.kohsuke.github.GHCommitBuilder
-
public class GHCommitBuilder extends Object
Builder pattern for creating a new commit. Based on https://developer.github.com/v3/git/commits/#create-a-commit
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GHCommitBuilder
author(String name, String email, Date date)
Configures the author of this commit.GHCommitBuilder
committer(String name, String email, Date date)
Configures the committer of this commit.GHCommit
create()
Creates a blob based on the parameters specified thus far.GHCommitBuilder
message(String message)
Message gh commit builder.GHCommitBuilder
parent(String parent)
Parent gh commit builder.GHCommitBuilder
tree(String tree)
Tree gh commit builder.GHCommitBuilder
withSignature(String signature)
Configures the PGP signature of this commit.
-
-
-
Method Detail
-
message
public GHCommitBuilder message(String message)
Message gh commit builder.- Parameters:
message
- the commit message- Returns:
- the gh commit builder
-
tree
public GHCommitBuilder tree(String tree)
Tree gh commit builder.- Parameters:
tree
- the SHA of the tree object this commit points to- Returns:
- the gh commit builder
-
parent
public GHCommitBuilder parent(String parent)
Parent gh commit builder.- Parameters:
parent
- the SHA of a parent commit.- Returns:
- the gh commit builder
-
author
public GHCommitBuilder author(String name, String email, Date date)
Configures the author of this commit.- Parameters:
name
- the nameemail
- the emaildate
- the date- Returns:
- the gh commit builder
-
withSignature
public GHCommitBuilder withSignature(String signature)
Configures the PGP signature of this commit.- Parameters:
signature
- the signature calculated from the commit- Returns:
- the gh commit builder
-
committer
public GHCommitBuilder committer(String name, String email, Date date)
Configures the committer of this commit.- Parameters:
name
- the nameemail
- the emaildate
- the date- Returns:
- the gh commit builder
-
create
public GHCommit create() throws IOException
Creates a blob based on the parameters specified thus far.- Returns:
- the gh commit
- Throws:
IOException
- the io exception
-
-