Top Description Fields Constructors Methods
org.eclipse.jgit.lib

public Class MutableObjectId

extends AnyObjectId
Class Inheritance
Imports
java.text.MessageFormat, org.eclipse.jgit.errors.InvalidObjectIdException, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.util.NB, .RawParseUtils

A mutable SHA-1 abstraction.

Field Summary

Inherited from org.eclipse.jgit.lib.AnyObjectId:
w1w2w3w4w5

Constructor Summary

AccessConstructor and Description
public
MutableObjectId()

Empty constructor.

pack-priv
MutableObjectId(MutableObjectId
original entry, to copy id from
src
)

Copying constructor.

Method Summary

Modifier and TypeMethod and Description
public void
private void
fromHexString(byte[] bs, int p)

public void
fromObjectId(AnyObjectId
the source id to copy from.
src
)

Copy an ObjectId into this mutable buffer.

public void
fromRaw(byte[]
the raw byte buffer to read from. At least 20 bytes must be available within this byte array.
bs
)

Convert an ObjectId from raw binary representation.

public void
fromRaw(byte[]
the raw byte buffer to read from. At least 20 bytes after p must be available within this byte array.
bs
,
int
position to read the first byte of data from.
p
)

Convert an ObjectId from raw binary representation.

public void
fromRaw(int[]
the raw int buffer to read from. At least 5 integers must be available within this integers array.
ints
)

Convert an ObjectId from binary representation expressed in integers.

public void
fromRaw(int[]
the raw int buffer to read from. At least 5 integers after p must be available within this integers array.
ints
,
int
position to read the first integer of data from.
p
)

Convert an ObjectId from binary representation expressed in integers.

public void
fromString(byte[]
the US-ASCII buffer to read from. At least 40 bytes after offset must be available within this byte array.
buf
,
int
position to read the first character from.
offset
)

Convert an ObjectId from hex characters (US-ASCII).

public void
fromString(String
the string to read from. Must be 40 characters long.
str
)

Convert an ObjectId from hex characters.

private static int
set(int w, int index, int value)

public void
set(int
an int.
a
,
int
an int.
b
,
int
an int.
c
,
int
an int.
d
,
int
an int.
e
)

Convert an ObjectId from binary representation expressed in integers.

public void
setByte(int
index of the byte to set in the raw form of the ObjectId. Must be in range [0, org.eclipse.jgit.lib.Constants#OBJECT_ID_LENGTH).
index
,
int
the value of the specified byte at index. Values are unsigned and thus are in the range [0,255] rather than the signed byte range of [-128, 127].
value
)

Set any byte in the id.

public ObjectId
toObjectId()

Implements abstract org.eclipse.jgit.lib.AnyObjectId.toObjectId.

Obtain an immutable copy of this current object name value.

Inherited from org.eclipse.jgit.lib.AnyObjectId:
abbreviatecompareTocompareTocompareTocopycopyRawTocopyRawTocopyRawTocopyRawTocopyTocopyTocopyTocopyTocopyTocopyToequalsequalsformatHexChargetBytegetFirstBytegetNamehashCodeisEqualnamestartsWithtoString

Constructor Detail

MutableObjectIdback to summary
public MutableObjectId()

Empty constructor. Initialize object with default (zeros) value.

MutableObjectIdback to summary
pack-priv MutableObjectId(MutableObjectId src)

Copying constructor.

Parameters
src:MutableObjectId

original entry, to copy id from

Method Detail

clearback to summary
public void clear()

Make this id match org.eclipse.jgit.lib.ObjectId#zeroId().

fromHexStringback to summary
private void fromHexString(byte[] bs, int p)
fromObjectIdback to summary
public void fromObjectId(AnyObjectId src)

Copy an ObjectId into this mutable buffer.

Parameters
src:AnyObjectId

the source id to copy from.

fromRawback to summary
public void fromRaw(byte[] bs)

Convert an ObjectId from raw binary representation.

Parameters
bs:byte[]

the raw byte buffer to read from. At least 20 bytes must be available within this byte array.

fromRawback to summary
public void fromRaw(byte[] bs, int p)

Convert an ObjectId from raw binary representation.

Parameters
bs:byte[]

the raw byte buffer to read from. At least 20 bytes after p must be available within this byte array.

p:int

position to read the first byte of data from.

fromRawback to summary
public void fromRaw(int[] ints)

Convert an ObjectId from binary representation expressed in integers.

Parameters
ints:int[]

the raw int buffer to read from. At least 5 integers must be available within this integers array.

fromRawback to summary
public void fromRaw(int[] ints, int p)

Convert an ObjectId from binary representation expressed in integers.

Parameters
ints:int[]

the raw int buffer to read from. At least 5 integers after p must be available within this integers array.

p:int

position to read the first integer of data from.

fromStringback to summary
public void fromString(byte[] buf, int offset)

Convert an ObjectId from hex characters (US-ASCII).

Parameters
buf:byte[]

the US-ASCII buffer to read from. At least 40 bytes after offset must be available within this byte array.

offset:int

position to read the first character from.

fromStringback to summary
public void fromString(String str)

Convert an ObjectId from hex characters.

Parameters
str:String

the string to read from. Must be 40 characters long.

setback to summary
private static int set(int w, int index, int value)
setback to summary
public void set(int a, int b, int c, int d, int e)

Convert an ObjectId from binary representation expressed in integers.

Parameters
a:int

an int.

b:int

an int.

c:int

an int.

d:int

an int.

e:int

an int.

Since
4.7
setByteback to summary
public void setByte(int index, int value)

Set any byte in the id.

Parameters
index:int

index of the byte to set in the raw form of the ObjectId. Must be in range [0, org.eclipse.jgit.lib.Constants#OBJECT_ID_LENGTH).

value:int

the value of the specified byte at index. Values are unsigned and thus are in the range [0,255] rather than the signed byte range of [-128, 127].

Exceptions
ArrayIndexOutOfBoundsException:
index is less than 0, equal to org.eclipse.jgit.lib.Constants#OBJECT_ID_LENGTH, or greater than org.eclipse.jgit.lib.Constants#OBJECT_ID_LENGTH.
toObjectIdback to summary
public ObjectId toObjectId()

Implements abstract org.eclipse.jgit.lib.AnyObjectId.toObjectId.

Doc from org.eclipse.jgit.lib.AnyObjectId.toObjectId.

Obtain an immutable copy of this current object name value.

See copy() if this is a possibly subclassed (but immutable) identity and the application needs a lightweight identity only reference.

Returns:ObjectId

an immutable copy. May be this if this is already an immutable instance.

Annotations
@Override