org.eclipse.jgit.storage.dht
Class CachedPackKey

java.lang.Object
  extended by org.eclipse.jgit.storage.dht.CachedPackKey
All Implemented Interfaces:
RowKey

public final class CachedPackKey
extends java.lang.Object
implements RowKey

Unique identifier of a GitStore.CachedPackInfo in the DHT.


Method Summary
 byte[] asBytes()
           
 java.lang.String asString()
           
 boolean equals(java.lang.Object other)
          Compare this key to another key for equality.
static CachedPackKey fromBytes(byte[] key)
           
static CachedPackKey fromBytes(byte[] key, int ptr, int len)
           
static CachedPackKey fromInfo(GitStore.CachedPackInfo info)
           
static CachedPackKey fromString(java.lang.String key)
           
 ObjectId getName()
           
 ObjectId getVersion()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

fromBytes

public static CachedPackKey fromBytes(byte[] key)
Parameters:
key -
Returns:
the key

fromBytes

public static CachedPackKey fromBytes(byte[] key,
                                      int ptr,
                                      int len)
Parameters:
key -
ptr -
len -
Returns:
the key

fromString

public static CachedPackKey fromString(java.lang.String key)
Parameters:
key -
Returns:
the key

fromInfo

public static CachedPackKey fromInfo(GitStore.CachedPackInfo info)
Parameters:
info -
Returns:
the key

getName

public ObjectId getName()
Returns:
unique SHA-1 name of the pack.

getVersion

public ObjectId getVersion()
Returns:
unique version of the pack.

asBytes

public byte[] asBytes()
Specified by:
asBytes in interface RowKey
Returns:
key formatted as byte array for storage in the DHT.

asString

public java.lang.String asString()
Specified by:
asString in interface RowKey
Returns:
key formatted as a String for storage in the DHT.

hashCode

public int hashCode()
Specified by:
hashCode in interface RowKey
Overrides:
hashCode in class java.lang.Object
Returns:
relatively unique hash code value for in-memory compares.

equals

public boolean equals(java.lang.Object other)
Description copied from interface: RowKey
Compare this key to another key for equality.

Specified by:
equals in interface RowKey
Overrides:
equals in class java.lang.Object
Parameters:
other - the other key instance, may be null.
Returns:
true if these keys reference the same row.

toString

public java.lang.String toString()
Specified by:
toString in interface RowKey
Overrides:
toString in class java.lang.Object
Returns:
pretty printable string for debugging/reporting only.


Copyright © 2011. All Rights Reserved.