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

public Class LongObjectId

extends AnyLongObjectId
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, org.eclipse.jgit.lfs.errors.InvalidLongObjectIdException, org.eclipse.jgit.util.NB, .RawParseUtils

A SHA-256 abstraction. Ported to SHA-256 from org.eclipse.jgit.lib.ObjectId
Since
4.3

Field Summary

Modifier and TypeField and Description
private static final long
private static final LongObjectId
private static final String
Inherited from org.eclipse.jgit.lfs.lib.AnyLongObjectId:
w1w2w3w4

Constructor Summary

AccessConstructor and Description
pack-priv
LongObjectId(final long new_1, final long new_2, final long new_3, final long new_4)

protected
LongObjectId(AnyLongObjectId
another already parsed LongObjectId to copy the value out of.
src
)

Initialize this instance by copying another existing LongObjectId.

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the two identifiers are the same.
equals
(final byte[]
the first buffer to compare against. Must have at least 32 bytes from position fi through the end of the buffer.
firstBuffer
,
final int
first offset within firstBuffer to begin testing.
fi
,
final byte[]
the second buffer to compare against. Must have at least 32 bytes from position si through the end of the buffer.
secondBuffer
,
final int
first offset within secondBuffer to begin testing.
si
)

Compare two object identifier byte sequences for equality.

private static final LongObjectId
fromHexString(byte[] bs, int p)

public static final LongObjectId

Returns:

the converted object id.
fromRaw
(byte[]
the raw byte buffer to read from. At least 32 bytes must be available within this byte array.
bs
)

Convert a LongObjectId from raw binary representation.

public static final LongObjectId

Returns:

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

Convert a LongObjectId from raw binary representation.

public static final LongObjectId

Returns:

the converted object id.
fromRaw
(long[]
the raw long buffer to read from. At least 4 longs must be available within this long array.
is
)

Convert a LongObjectId from raw binary representation.

public static final LongObjectId

Returns:

the converted object id.
fromRaw
(long[]
the raw long buffer to read from. At least 4 longs after p must be available within this long array.
is
,
int
position to read the first long of data from.
p
)

Convert a LongObjectId from raw binary representation.

public static final LongObjectId

Returns:

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

Convert a LongObjectId from hex characters (US-ASCII).

public static LongObjectId

Returns:

the converted object id.
fromString
(String
the string to read from. Must be 64 characters long.
str
)

Convert a LongObjectId from hex characters.

public static final boolean

Returns:

true if the string can converted into an LongObjectId.
isId
(String
the string to test.
id
)

Test a string of characters to verify that it can be interpreted as LongObjectId.

private void
public LongObjectId
toObjectId()

Implements abstract org.eclipse.jgit.lfs.lib.AnyLongObjectId.toObjectId.

Obtain an immutable copy of this current object.

public static final String

Returns:

the hex string conversion of this id's content.
toString
(LongObjectId
the id to convert. May be null.
i
)

Convert a LongObjectId into a hex string representation.

private void
public static final LongObjectId

Returns:

the all-zero LongObjectId, often used to stand-in for no object.
zeroId
()

Get the special all-zero LongObjectId.

Inherited from org.eclipse.jgit.lfs.lib.AnyLongObjectId:
abbreviatecompareTocompareTocompareTocopycopyRawTocopyRawTocopyRawTocopyRawTocopyTocopyTocopyTocopyTocopyTocopyToequalsequalsformatHexChargetBytegetFirstBytegetNamegetSecondBytehashCodeisEqualnamestartsWithtoHexCharArraytoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID
ZEROIDback to summary
private static final LongObjectId ZEROID
ZEROID_STRback to summary
private static final String ZEROID_STR

Constructor Detail

LongObjectIdback to summary
pack-priv LongObjectId(final long new_1, final long new_2, final long new_3, final long new_4)
LongObjectIdback to summary
protected LongObjectId(AnyLongObjectId src)

Initialize this instance by copying another existing LongObjectId.

This constructor is mostly useful for subclasses which want to extend a LongObjectId with more properties, but initialize from an existing LongObjectId instance acquired by other means.

Parameters
src:AnyLongObjectId

another already parsed LongObjectId to copy the value out of.

Method Detail

equalsback to summary
public static boolean equals(final byte[] firstBuffer, final int fi, final byte[] secondBuffer, final int si)

Compare two object identifier byte sequences for equality.

Parameters
firstBuffer:byte[]

the first buffer to compare against. Must have at least 32 bytes from position fi through the end of the buffer.

fi:int

first offset within firstBuffer to begin testing.

secondBuffer:byte[]

the second buffer to compare against. Must have at least 32 bytes from position si through the end of the buffer.

si:int

first offset within secondBuffer to begin testing.

Returns:boolean

true if the two identifiers are the same.

fromHexStringback to summary
private static final LongObjectId fromHexString(byte[] bs, int p)
fromRawback to summary
public static final LongObjectId fromRaw(byte[] bs)

Convert a LongObjectId from raw binary representation.

Parameters
bs:byte[]

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

Returns:LongObjectId

the converted object id.

fromRawback to summary
public static final LongObjectId fromRaw(byte[] bs, int p)

Convert a LongObjectId from raw binary representation.

Parameters
bs:byte[]

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

p:int

position to read the first byte of data from.

Returns:LongObjectId

the converted object id.

fromRawback to summary
public static final LongObjectId fromRaw(long[] is)

Convert a LongObjectId from raw binary representation.

Parameters
is:long[]

the raw long buffer to read from. At least 4 longs must be available within this long array.

Returns:LongObjectId

the converted object id.

fromRawback to summary
public static final LongObjectId fromRaw(long[] is, int p)

Convert a LongObjectId from raw binary representation.

Parameters
is:long[]

the raw long buffer to read from. At least 4 longs after p must be available within this long array.

p:int

position to read the first long of data from.

Returns:LongObjectId

the converted object id.

fromStringback to summary
public static final LongObjectId fromString(byte[] buf, int offset)

Convert a LongObjectId from hex characters (US-ASCII).

Parameters
buf:byte[]

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

offset:int

position to read the first character from.

Returns:LongObjectId

the converted object id.

fromStringback to summary
public static LongObjectId fromString(String str)

Convert a LongObjectId from hex characters.

Parameters
str:String

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

Returns:LongObjectId

the converted object id.

isIdback to summary
public static final boolean isId(String id)

Test a string of characters to verify that it can be interpreted as LongObjectId.

If true the string can be parsed with fromString(String).

Parameters
id:String

the string to test.

Returns:boolean

true if the string can converted into an LongObjectId.

readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException
toObjectIdback to summary
public LongObjectId toObjectId()

Implements abstract org.eclipse.jgit.lfs.lib.AnyLongObjectId.toObjectId.

Doc from org.eclipse.jgit.lfs.lib.AnyLongObjectId.toObjectId.

Obtain an immutable copy of this current object.

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

Returns:LongObjectId

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

Annotations
@Override
toStringback to summary
public static final String toString(LongObjectId i)

Convert a LongObjectId into a hex string representation.

Parameters
i:LongObjectId

the id to convert. May be null.

Returns:String

the hex string conversion of this id's content.

writeObjectback to summary
private void writeObject(ObjectOutputStream os) throws IOException
zeroIdback to summary
public static final LongObjectId zeroId()

Get the special all-zero LongObjectId.

Returns:LongObjectId

the all-zero LongObjectId, often used to stand-in for no object.