public class ObjectId extends AnyObjectId implements Serializable
Modifier | Constructor and Description |
---|---|
protected |
ObjectId(AnyObjectId src)
Initialize this instance by copying another existing ObjectId.
|
|
ObjectId(int new_1,
int new_2,
int new_3,
int new_4,
int new_5)
Construct an ObjectId from 160 bits provided in 5 words.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(byte[] firstBuffer,
int fi,
byte[] secondBuffer,
int si)
Compare two object identifier byte sequences for equality.
|
static ObjectId |
fromRaw(byte[] bs)
Convert an ObjectId from raw binary representation.
|
static ObjectId |
fromRaw(byte[] bs,
int p)
Convert an ObjectId from raw binary representation.
|
static ObjectId |
fromRaw(int[] is)
Convert an ObjectId from raw binary representation.
|
static ObjectId |
fromRaw(int[] is,
int p)
Convert an ObjectId from raw binary representation.
|
static ObjectId |
fromString(byte[] buf,
int offset)
Convert an ObjectId from hex characters (US-ASCII).
|
static ObjectId |
fromString(String str)
Convert an ObjectId from hex characters.
|
static boolean |
isId(String id)
Test a string of characters to verify it is a hex format.
|
ObjectId |
toObjectId()
Obtain an immutable copy of this current object name value.
|
static String |
toString(ObjectId i)
Convert an ObjectId into a hex string representation.
|
static ObjectId |
zeroId()
Get the special all-null ObjectId.
|
abbreviate, compareTo, compareTo, compareTo, copy, copyRawTo, copyRawTo, copyRawTo, copyRawTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, equals, equals, equals, getByte, getFirstByte, getName, hashCode, isEqual, name, startsWith, toString
public ObjectId(int new_1, int new_2, int new_3, int new_4, int new_5)
new_1
- an intnew_2
- an intnew_3
- an intnew_4
- an intnew_5
- an intprotected ObjectId(AnyObjectId src)
This constructor is mostly useful for subclasses who want to extend an ObjectId with more properties, but initialize from an existing ObjectId instance acquired by other means.
src
- another already parsed ObjectId to copy the value out of.public static final ObjectId zeroId()
public static final boolean isId(@Nullable String id)
If true the string can be parsed with fromString(String)
.
id
- the string to test.public static final String toString(ObjectId i)
i
- the id to convert. May be null.public static boolean equals(byte[] firstBuffer, int fi, byte[] secondBuffer, int si)
firstBuffer
- the first buffer to compare against. Must have at least 20
bytes from position fi through the end of the buffer.fi
- first offset within firstBuffer to begin testing.secondBuffer
- the second buffer to compare against. Must have at least 20
bytes from position si through the end of the buffer.si
- first offset within secondBuffer to begin testing.public static final ObjectId fromRaw(byte[] bs)
bs
- the raw byte buffer to read from. At least 20 bytes must be
available within this byte array.public static final ObjectId fromRaw(byte[] bs, int p)
bs
- the raw byte buffer to read from. At least 20 bytes after p
must be available within this byte array.p
- position to read the first byte of data from.public static final ObjectId fromRaw(int[] is)
is
- the raw integers buffer to read from. At least 5 integers must
be available within this int array.public static final ObjectId fromRaw(int[] is, int p)
is
- the raw integers buffer to read from. At least 5 integers
after p must be available within this int array.p
- position to read the first integer of data from.public static final ObjectId fromString(byte[] buf, int offset)
buf
- the US-ASCII buffer to read from. At least 40 bytes after
offset must be available within this byte array.offset
- position to read the first character from.public static ObjectId fromString(String str)
str
- the string to read from. Must be 40 characters long.public ObjectId toObjectId()
See AnyObjectId.copy()
if this
is a possibly subclassed (but
immutable) identity and the application needs a lightweight identity
only reference.
toObjectId
in class AnyObjectId
this
if this is already
an immutable instance.Copyright © 2019 Eclipse JGit Project. All rights reserved.