Class 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 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 name
        email - the email
        date - 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 name
        email - the email
        date - 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