org.eclipse.jgit.lfs.lib.LongObjectId .
Enable abbreviating SHA-256 strings used by Git LFS, using sufficient leading digits from the LongObjectId 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.
Ported to SHA-256 from org.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | nibbles
Number of half-bytes used by this id. |
| private static final long | |
| pack-priv final long | |
| pack-priv final long | |
| pack-priv final long | |
| pack-priv final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | AbbreviatedLongObjectId(final int n, final long new_1, final long new_2, final long new_3, final long new_4)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| private static final AbbreviatedLongObjectId | |
| public static final AbbreviatedLongObjectId | Returns: the converted object id.the id)org. to convert from.Convert an AbbreviatedObjectId from an
|
| public static final AbbreviatedLongObjectId | Returns: the converted object id.the US-ASCII buffer to read from. buf, final int position to read the first character from. offset, final int one past the last position to read ( end)end-offset is
the length of the string).Convert an AbbreviatedObjectId from hex characters (US-ASCII). |
| public static final AbbreviatedLongObjectId | Returns: the converted object id.the string to read from. Must be <= 64 characters. str)Convert an AbbreviatedLongObjectId from hex characters. |
| public final int | Returns: value for a fan-out style map, only valid of length >= 2.Get the first byte of this id |
| public int | |
| private static final long | |
| public boolean | |
| public static final boolean | |
| public int | |
| pack-priv static long | |
| private long | |
| public final String | |
| public final int | Returns: <0 if this abbreviation names an object that is less thanother; 0 if this abbreviation exactly matches the
first length() digits of other.name();
>0 if this abbreviation names an object that is after
other.the other object id. other)Compares this abbreviation to a full object id. |
| public final int | Returns: <0 if this abbreviation names an object that is less thanother; 0 if this abbreviation exactly matches the
first length() digits of other.name();
>0 if this abbreviation names an object that is after
other.array containing the other LongObjectId in network byte order. bs, int position within p)bs to start the compare at. At least
32 bytes, starting at this position are required.Compare this abbreviation to a network-byte-order LongObjectId. |
| public final int | Returns: <0 if this abbreviation names an object that is less thanother; 0 if this abbreviation exactly matches the
first length() digits of other.name();
>0 if this abbreviation names an object that is after
other.array containing the other LongObjectId in network byte order. bs, int position within p)bs to start the compare at. At least 4
longs, starting at this position are required.Compare this abbreviation to a network-byte-order LongObjectId. |
| public LongObjectId | |
| public String |
| nibbles | back to summary |
|---|---|
| pack-priv final int nibbles Number of half-bytes used by this id. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| w1 | back to summary |
|---|---|
| pack-priv final long w1 | |
| w2 | back to summary |
|---|---|
| pack-priv final long w2 | |
| w3 | back to summary |
|---|---|
| pack-priv final long w3 | |
| w4 | back to summary |
|---|---|
| pack-priv final long w4 | |
| AbbreviatedLongObjectId | back to summary |
|---|---|
| pack-priv AbbreviatedLongObjectId(final int n, final long new_1, final long new_2, final long new_3, final long new_4) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| fromHexString | back to summary |
|---|---|
| private static final AbbreviatedLongObjectId fromHexString(final byte[] bs, int ptr, final int end) | |
| fromLongObjectId | back to summary |
|---|---|
| public static final AbbreviatedLongObjectId fromLongObjectId(AnyLongObjectId id) Convert an AbbreviatedObjectId from an
This method copies over all bits of the Id, and is therefore complete
(see
| |
| fromString | back to summary |
|---|---|
| public static final AbbreviatedLongObjectId fromString(final byte[] buf, final int offset, final int end) Convert an AbbreviatedObjectId from hex characters (US-ASCII).
| |
| fromString | back to summary |
|---|---|
| public static final AbbreviatedLongObjectId fromString(String str) Convert an AbbreviatedLongObjectId from hex characters.
| |
| getFirstByte | back to summary |
|---|---|
| public final int getFirstByte() Get the first byte of this id
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hexUInt64 | back to summary |
|---|---|
| private static final long hexUInt64(final byte[] bs, int p, final int end) | |
| isComplete | back to summary |
|---|---|
| public boolean isComplete() Check if this id is complete
| |
| isId | back to summary |
|---|---|
| public static final boolean isId(String id) Test a string of characters to verify it is a hex format.
If true the string can be parsed with
| |
| length | back to summary |
|---|---|
| public int length() Get length
| |
| mask | back to summary |
|---|---|
| pack-priv static long mask(int nibbles, long word, long v) | |
| mask | back to summary |
|---|---|
| private long mask(long word, long v) | |
| name | back to summary |
|---|---|
| public final String name() name.
| |
| prefixCompare | back to summary |
|---|---|
| public final int prefixCompare(AnyLongObjectId other) Compares this abbreviation to a full object id.
| |
| prefixCompare | back to summary |
|---|---|
| public final int prefixCompare(byte[] bs, int p) Compare this abbreviation to a network-byte-order LongObjectId.
| |
| prefixCompare | back to summary |
|---|---|
| public final int prefixCompare(long[] bs, int p) Compare this abbreviation to a network-byte-order LongObjectId.
| |
| toLongObjectId | back to summary |
|---|---|
| public LongObjectId toLongObjectId() Convert to LongObjectId
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |