/** * Convert an ObjectId from raw binary representation. * * @param is * the raw integers buffer to read from. At least 5 integers * after p must be available within this int array. * @param p * position to read the first integer of data from. * @return the converted object id. */ public static final ObjectId fromRaw(int[] is, int p) { return new ObjectId(is[p], is[p + 1], is[p + 2], is[p + 3], is[p + 4]); }
ObjectId toObjectId() { return new ObjectId(a, b, c, d, e); } }
/** {@inheritDoc} */ @Override public ObjectId toObjectId() { return new ObjectId(this); } }
/** * Obtain an immutable copy of this current object name value. * <p> * Only returns <code>this</code> if this instance is an unsubclassed * instance of {@link org.eclipse.jgit.lib.ObjectId}; otherwise a new * instance is returned holding the same value. * <p> * This method is useful to shed any additional memory that may be tied to * the subclass, yet retain the unique identity of the object id for future * lookups within maps and repositories. * * @return an immutable copy, using the smallest memory footprint possible. */ public final ObjectId copy() { if (getClass() == ObjectId.class) return (ObjectId) this; return new ObjectId(this); }
/** * A complete ObjectId; null if {@link #isComplete()} is false * * @return a complete ObjectId; null if {@link #isComplete()} is false */ public ObjectId toObjectId() { return isComplete() ? new ObjectId(w1, w2, w3, w4, w5) : null; }
/** * Convert an ObjectId from raw binary representation. * * @param bs * the raw byte buffer to read from. At least 20 bytes after p * must be available within this byte array. * @param p * position to read the first byte of data from. * @return the converted object id. */ public static final ObjectId fromRaw(byte[] bs, int p) { final int a = NB.decodeInt32(bs, p); final int b = NB.decodeInt32(bs, p + 4); final int c = NB.decodeInt32(bs, p + 8); final int d = NB.decodeInt32(bs, p + 12); final int e = NB.decodeInt32(bs, p + 16); return new ObjectId(a, b, c, d, e); }
private static final ObjectId fromHexString(byte[] bs, int p) { try { final int a = RawParseUtils.parseHexInt32(bs, p); final int b = RawParseUtils.parseHexInt32(bs, p + 8); final int c = RawParseUtils.parseHexInt32(bs, p + 16); final int d = RawParseUtils.parseHexInt32(bs, p + 24); final int e = RawParseUtils.parseHexInt32(bs, p + 32); return new ObjectId(a, b, c, d, e); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidObjectIdException(bs, p, Constants.OBJECT_ID_STRING_LENGTH); } }
@Override public ObjectId toObjectId() { return new ObjectId(this); } }
/** * Convert an ObjectId from raw binary representation. * * @param is * the raw integers buffer to read from. At least 5 integers * after p must be available within this int array. * @param p * position to read the first integer of data from. * @return the converted object id. */ public static final ObjectId fromRaw(int[] is, int p) { return new ObjectId(is[p], is[p + 1], is[p + 2], is[p + 3], is[p + 4]); }
/** {@inheritDoc} */ @Override public ObjectId toObjectId() { return new ObjectId(this); } }
/** * Convert an ObjectId from raw binary representation. * * @param is * the raw integers buffer to read from. At least 5 integers * after p must be available within this int array. * @param p * position to read the first integer of data from. * @return the converted object id. */ public static final ObjectId fromRaw(final int[] is, final int p) { return new ObjectId(is[p], is[p + 1], is[p + 2], is[p + 3], is[p + 4]); }
ObjectId toObjectId() { return new ObjectId(a, b, c, d, e); } }
/** * Obtain an immutable copy of this current object name value. * <p> * Only returns <code>this</code> if this instance is an unsubclassed * instance of {@link org.eclipse.jgit.lib.ObjectId}; otherwise a new * instance is returned holding the same value. * <p> * This method is useful to shed any additional memory that may be tied to * the subclass, yet retain the unique identity of the object id for future * lookups within maps and repositories. * * @return an immutable copy, using the smallest memory footprint possible. */ public final ObjectId copy() { if (getClass() == ObjectId.class) return (ObjectId) this; return new ObjectId(this); }
/** * Obtain an immutable copy of this current object name value. * <p> * Only returns <code>this</code> if this instance is an unsubclassed * instance of {@link ObjectId}; otherwise a new instance is returned * holding the same value. * <p> * This method is useful to shed any additional memory that may be tied to * the subclass, yet retain the unique identity of the object id for future * lookups within maps and repositories. * * @return an immutable copy, using the smallest memory footprint possible. */ public final ObjectId copy() { if (getClass() == ObjectId.class) return (ObjectId) this; return new ObjectId(this); }
/** @return a complete ObjectId; null if {@link #isComplete()} is false */ public ObjectId toObjectId() { return isComplete() ? new ObjectId(w1, w2, w3, w4, w5) : null; }
/** * A complete ObjectId; null if {@link #isComplete()} is false * * @return a complete ObjectId; null if {@link #isComplete()} is false */ public ObjectId toObjectId() { return isComplete() ? new ObjectId(w1, w2, w3, w4, w5) : null; }
private static final ObjectId fromHexString(byte[] bs, int p) { try { final int a = RawParseUtils.parseHexInt32(bs, p); final int b = RawParseUtils.parseHexInt32(bs, p + 8); final int c = RawParseUtils.parseHexInt32(bs, p + 16); final int d = RawParseUtils.parseHexInt32(bs, p + 24); final int e = RawParseUtils.parseHexInt32(bs, p + 32); return new ObjectId(a, b, c, d, e); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidObjectIdException(bs, p, Constants.OBJECT_ID_STRING_LENGTH); } }
/** * Convert an ObjectId from raw binary representation. * * @param bs * the raw byte buffer to read from. At least 20 bytes after p * must be available within this byte array. * @param p * position to read the first byte of data from. * @return the converted object id. */ public static final ObjectId fromRaw(final byte[] bs, final int p) { final int a = NB.decodeInt32(bs, p); final int b = NB.decodeInt32(bs, p + 4); final int c = NB.decodeInt32(bs, p + 8); final int d = NB.decodeInt32(bs, p + 12); final int e = NB.decodeInt32(bs, p + 16); return new ObjectId(a, b, c, d, e); }
/** * Convert an ObjectId from raw binary representation. * * @param bs * the raw byte buffer to read from. At least 20 bytes after p * must be available within this byte array. * @param p * position to read the first byte of data from. * @return the converted object id. */ public static final ObjectId fromRaw(byte[] bs, int p) { final int a = NB.decodeInt32(bs, p); final int b = NB.decodeInt32(bs, p + 4); final int c = NB.decodeInt32(bs, p + 8); final int d = NB.decodeInt32(bs, p + 12); final int e = NB.decodeInt32(bs, p + 16); return new ObjectId(a, b, c, d, e); }
private static final ObjectId fromHexString(final byte[] bs, int p) { try { final int a = RawParseUtils.parseHexInt32(bs, p); final int b = RawParseUtils.parseHexInt32(bs, p + 8); final int c = RawParseUtils.parseHexInt32(bs, p + 16); final int d = RawParseUtils.parseHexInt32(bs, p + 24); final int e = RawParseUtils.parseHexInt32(bs, p + 32); return new ObjectId(a, b, c, d, e); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidObjectIdException(bs, p, Constants.OBJECT_ID_STRING_LENGTH); } }