org.eclipse.jgit.storage.dht
Interface RowKey

All Known Implementing Classes:
CachedPackKey, ChunkKey, ObjectIndexKey, RefKey, RepositoryKey, RepositoryName

public interface RowKey

Key for any row that the DHT will be asked to store.

Implementations of this interface know how to encode and decode themselves from a byte array format, expecting the DHT to use the byte array as the row key within the database.

It is strongly encouraged to use only row keys that are valid UTF-8 strings, as most DHT systems have client tools that can interact with rows using the UTF-8 encoding.


Method Summary
 byte[] asBytes()
           
 java.lang.String asString()
           
 boolean equals(java.lang.Object other)
          Compare this key to another key for equality.
 int hashCode()
           
 java.lang.String toString()
           
 

Method Detail

asBytes

byte[] asBytes()
Returns:
key formatted as byte array for storage in the DHT.

asString

java.lang.String asString()
Returns:
key formatted as a String for storage in the DHT.

hashCode

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

equals

boolean equals(java.lang.Object other)
Compare this key to another key for equality.

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

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


Copyright © 2011. All Rights Reserved.