Package io.ray.api.id
Class BaseId
java.lang.Object
io.ray.api.id.BaseId
- All Implemented Interfaces:
Serializable
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseId(byte[] id)Create a BaseId instance according to the input byte array. -
Method Summary
Modifier and TypeMethodDescriptionprotected static byte[]booleanbyte[]getBytes()Get the byte data of this id.inthashCode()protected static byte[]hexString2Bytes(String hex)booleanisNil()Returns true if this id is nil.abstract intsize()Derived class should implement this function.Convert the byte data to a ByteBuffer.toString()
-
Constructor Details
-
BaseId
protected BaseId(byte[] id)Create a BaseId instance according to the input byte array.
-
-
Method Details
-
getBytes
public byte[] getBytes()Get the byte data of this id. -
toByteBuffer
Convert the byte data to a ByteBuffer. -
isNil
public boolean isNil()Returns true if this id is nil. -
size
public abstract int size()Derived class should implement this function.- Returns:
- The length of this id in bytes.
-
hashCode
public int hashCode() -
equals
-
toString
-
hexString2Bytes
-
byteBuffer2Bytes
-