Package org.eclipse.jgit.api
Class AddNoteCommand
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<Note>
-
- org.eclipse.jgit.api.AddNoteCommand
-
- All Implemented Interfaces:
java.util.concurrent.Callable<Note>
public class AddNoteCommand extends GitCommand<Note>
Add object notes.- See Also:
- Git documentation about Notes
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AddNoteCommand(Repository repo)
Constructor for AddNoteCommand
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Note
call()
(package private) static void
commitNoteMap(Repository r, java.lang.String ref, RevWalk walk, NoteMap map, RevCommit notesCommit, ObjectInserter inserter, java.lang.String msg)
AddNoteCommand
setMessage(java.lang.String message)
Set the notes messageAddNoteCommand
setNotesRef(java.lang.String notesRef)
Set name of aRef
to read notes fromAddNoteCommand
setObjectId(RevObject id)
Sets the object id of object you want a note on.-
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
-
-
-
Field Detail
-
id
private RevObject id
-
message
private java.lang.String message
-
notesRef
private java.lang.String notesRef
-
-
Constructor Detail
-
AddNoteCommand
protected AddNoteCommand(Repository repo)
Constructor for AddNoteCommand- Parameters:
repo
- theRepository
-
-
Method Detail
-
call
public Note call() throws GitAPIException
Execute the command
- Specified by:
call
in interfacejava.util.concurrent.Callable<Note>
- Specified by:
call
in classGitCommand<Note>
- Throws:
GitAPIException
-
setObjectId
public AddNoteCommand setObjectId(RevObject id)
Sets the object id of object you want a note on. If the object already has a note, the existing note will be replaced.- Parameters:
id
- aRevObject
- Returns:
this
-
setMessage
public AddNoteCommand setMessage(java.lang.String message)
Set the notes message- Parameters:
message
- the notes message used when adding a note- Returns:
this
-
commitNoteMap
static void commitNoteMap(Repository r, java.lang.String ref, RevWalk walk, NoteMap map, RevCommit notesCommit, ObjectInserter inserter, java.lang.String msg) throws java.io.IOException
- Throws:
java.io.IOException
-
setNotesRef
public AddNoteCommand setNotesRef(java.lang.String notesRef)
Set name of aRef
to read notes from- Parameters:
notesRef
- the ref to read notes from. Note, the default value ofConstants.R_NOTES_COMMITS
will be used if nothing is set- Returns:
this
- See Also:
Constants.R_NOTES_COMMITS
-
-