|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.lib.SymbolicRef
public class SymbolicRef
A reference that indirectly points at another Ref
.
A symbolic reference always derives its current value from the target reference.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.jgit.lib.Ref |
---|
Ref.Storage |
Constructor Summary | |
---|---|
SymbolicRef(String refName,
Ref target)
Create a new ref pairing. |
Method Summary | |
---|---|
Ref |
getLeaf()
Traverse target references until Ref.isSymbolic() is false. |
String |
getName()
What this ref is called within the repository. |
ObjectId |
getObjectId()
Cached value of this ref. |
ObjectId |
getPeeledObjectId()
Cached value of ref^{} (the ref peeled to commit). |
Ref.Storage |
getStorage()
How was this ref obtained? |
Ref |
getTarget()
Get the reference this reference points to, or this . |
boolean |
isPeeled()
|
boolean |
isSymbolic()
Test if this reference is a symbolic reference. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SymbolicRef(String refName, Ref target)
refName
- name of this ref.target
- the ref we reference and derive our value from.Method Detail |
---|
public String getName()
Ref
getName
in interface Ref
public boolean isSymbolic()
Ref
A symbolic reference does not have its own ObjectId
value, but
instead points to another Ref
in the same database and always
uses that other reference's value as its own.
isSymbolic
in interface Ref
public Ref getLeaf()
Ref
Ref.isSymbolic()
is false.
If Ref.isSymbolic()
is false, returns this
.
If Ref.isSymbolic()
is true, this method recursively traverses
Ref.getTarget()
until Ref.isSymbolic()
returns false.
This method is effectively
return isSymbolic() ? getTarget().getLeaf() : this;
getLeaf
in interface Ref
public Ref getTarget()
Ref
this
.
If Ref.isSymbolic()
is true this method returns the reference it
directly names, which might not be the leaf reference, but could be
another symbolic reference.
If this is a leaf level reference that contains its own ObjectId,this
method returns this
.
getTarget
in interface Ref
this
.public ObjectId getObjectId()
Ref
getObjectId
in interface Ref
public Ref.Storage getStorage()
Ref
The current storage model of a Ref may influence how the ref must be updated or deleted from the repository.
getStorage
in interface Ref
public ObjectId getPeeledObjectId()
Ref
ref^{}
(the ref peeled to commit).
getPeeledObjectId
in interface Ref
public boolean isPeeled()
isPeeled
in interface Ref
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |