public class TagBuilder extends ObjectBuilder
RevWalk
and obtain a RevTag
instance by calling
RevWalk.parseTag(AnyObjectId)
.Constructor and Description |
---|
TagBuilder() |
Modifier and Type | Method and Description |
---|---|
byte[] |
build()
Format this builder's state as an annotated tag object.
|
ObjectId |
getObjectId()
Get the object this tag refers to.
|
int |
getObjectType()
Get the type of object this tag refers to.
|
String |
getTag()
Get short name of the tag (no
refs/tags/ prefix). |
PersonIdent |
getTagger()
Get creator of this tag.
|
void |
setObjectId(AnyObjectId obj,
int objType)
Set the object this tag refers to, and its type.
|
void |
setObjectId(RevObject obj)
Set the object this tag refers to, and infer its type.
|
void |
setTag(String shortName)
Set the name of this tag.
|
void |
setTagger(PersonIdent taggerIdent)
Set the creator of this tag.
|
byte[] |
toByteArray()
Deprecated.
since 5.11; use
build() instead |
String |
toString() |
getAuthor, getEncoding, getGpgSignature, getMessage, setAuthor, setEncoding, setGpgSignature, setMessage
public int getObjectType()
public ObjectId getObjectId()
public void setObjectId(AnyObjectId obj, int objType)
obj
- the object.objType
- the type of obj
. Must be a valid type code.public void setObjectId(RevObject obj)
obj
- the object the tag will refer to.public String getTag()
refs/tags/
prefix).refs/tags/
prefix).public void setTag(String shortName)
shortName
- new short name of the tag. This short name should not start
with refs/
as typically a tag is stored under the
reference derived from "refs/tags/" + getTag()
.public PersonIdent getTagger()
public void setTagger(PersonIdent taggerIdent)
taggerIdent
- the creator. May be null.public byte[] build() throws UnsupportedEncodingException
build
in class ObjectBuilder
UnsupportedEncodingException
- the encoding specified by ObjectBuilder.getEncoding()
is not
supported by this Java runtime.@Deprecated public byte[] toByteArray()
build()
insteadnull
if the tag cannot be
encodedCopyright © 2021 Eclipse JGit Project. All rights reserved.