Package org.syncany.database
Class ObjectId
- java.lang.Object
-
- org.syncany.database.ObjectId
-
- Direct Known Subclasses:
ChunkEntry.ChunkChecksum
,FileContent.FileChecksum
,MultiChunkEntry.MultiChunkId
,PartialFileHistory.FileHistoryId
public abstract class ObjectId extends java.lang.Object
The object ID is a generic identifier used by the database entities. As of now, it uses a byte array internally, but could also use different more memory-preserving methods (such as two longs).
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
identifier
-
Constructor Summary
Constructors Constructor Description ObjectId(byte[] identifier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
byte[]
getBytes()
Returns the raw representation of the object identifier in the form of a byte array.int
hashCode()
static byte[]
parseObjectId(java.lang.String s)
static byte[]
secureRandomBytes(int size)
java.lang.String
toString()
Converts the byte-array based identifier to a lower case hex string and returns this string.
-
-
-
Field Detail
-
identifier
protected byte[] identifier
-
-
Constructor Detail
-
ObjectId
public ObjectId(byte[] identifier)
-
-
Method Detail
-
getBytes
public byte[] getBytes()
Returns the raw representation of the object identifier in the form of a byte array.
-
toString
public java.lang.String toString()
Converts the byte-array based identifier to a lower case hex string and returns this string.- Overrides:
toString
in classjava.lang.Object
-
parseObjectId
public static byte[] parseObjectId(java.lang.String s)
-
secureRandomBytes
public static byte[] secureRandomBytes(int size)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-