br.com.objectos.git
Class MutableCommit

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

public final class MutableCommit
extends Object
implements br.com.objectos.core.object.ToStringObject

A class for creating a commit object suitable for writing to a repository.

Since:
3

Constructor Summary
MutableCommit()
          Creates a new empty mutable commit instance.
 
Method Summary
 void addParent(ObjectId parent)
          Adds the specified object ID as a parent of this commit.
 void clear()
          Sets this commit to the same state as if it was just instantiated.
 void formatToString(StringBuilder toString, int level)
           
 void setAuthor(Identification author)
          Sets the author of this commit to the specified value.
 void setCommitter(Identification committer)
          Sets the committer of this commit to the specified value.
 void setMessage(String message)
          Sets the message of this commit to the specified value.
 void setTree(ObjectId tree)
          Sets the tree of this commit to the specified value.
 String toString()
          Returns the string representation of this commit as defined by the ToStringObject.formatToString(StringBuilder, int) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableCommit

public MutableCommit()
Creates a new empty mutable commit instance.

Method Detail

addParent

public final void addParent(ObjectId parent)
Adds the specified object ID as a parent of this commit.

Parameters:
parent - the additional parent of this commit

clear

public final void clear()
Sets this commit to the same state as if it was just instantiated.


formatToString

public final void formatToString(StringBuilder toString,
                                 int level)
Specified by:
formatToString in interface br.com.objectos.core.object.ToStringObject

setAuthor

public final void setAuthor(Identification author)
Sets the author of this commit to the specified value.

Parameters:
author - the value to set as the author of this commit

setCommitter

public final void setCommitter(Identification committer)
Sets the committer of this commit to the specified value.

Parameters:
committer - the value to set as the committer of this commit

setMessage

public final void setMessage(String message)
Sets the message of this commit to the specified value.

Parameters:
message - the value to set as the message of this commit

setTree

public final void setTree(ObjectId tree)
Sets the tree of this commit to the specified value.

Parameters:
tree - the value to set as the tree of this commit

toString

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

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


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