|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.lib.AbbreviatedObjectId
public final class AbbreviatedObjectId
A prefix abbreviation of an ObjectId.
Sometimes Git produces abbreviated SHA-1 strings, using sufficient leading digits from the ObjectId name to still be unique within the repository the string was generated from. These ids are likely to be unique for a useful period of time, especially if they contain at least 6-10 hex digits.
This class converts the hex string into a binary form, to make it more efficient for matching against an object.
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
static AbbreviatedObjectId |
fromString(byte[] buf,
int offset,
int end)
Convert an AbbreviatedObjectId from hex characters (US-ASCII). |
static AbbreviatedObjectId |
fromString(java.lang.String str)
Convert an AbbreviatedObjectId from hex characters. |
int |
hashCode()
|
boolean |
isComplete()
|
int |
length()
|
java.lang.String |
name()
|
int |
prefixCompare(AnyObjectId other)
Compares this abbreviation to a full object id. |
ObjectId |
toObjectId()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static final AbbreviatedObjectId fromString(byte[] buf,
int offset,
int end)
buf - the US-ASCII buffer to read from.offset - position to read the first character from.end - one past the last position to read (end-offset is
the length of the string).
public static final AbbreviatedObjectId fromString(java.lang.String str)
str - the string to read from. Must be <= 40 characters.
public int length()
public boolean isComplete()
public ObjectId toObjectId()
isComplete() is falsepublic int prefixCompare(AnyObjectId other)
other - the other object id.
other; 0 if this abbreviation exactly matches the
first length() digits of other.name();
>0 if this abbreviation names an object that is after
other.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic final java.lang.String name()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||