Package io.hekate.util
Class UuidBase<T extends UuidBase<T>>
- java.lang.Object
-
- io.hekate.util.UuidBase<T>
-
- Type Parameters:
T
- Identifier type.
- All Implemented Interfaces:
Serializable
,Comparable<T>
- Direct Known Subclasses:
ClusterNodeId
,MessagingChannelId
public abstract class UuidBase<T extends UuidBase<T>> extends Object implements Serializable, Comparable<T>
Base class for custom UUID-based identifiers.- See Also:
- Serialized Form
-
-
Constructor Detail
-
UuidBase
public UuidBase()
Constructs new random identifier.
-
UuidBase
public UuidBase(long hiBits, long loBits)
Constructs new instance from the specified higher/lower bits.
-
UuidBase
public UuidBase(String s)
Creates new identifier from the specified string.Only strings that were produced by the
toString()
method can be parsed.- Parameters:
s
- String (seetoString()
).
-
-
Method Detail
-
hiBits
public long hiBits()
Returns higher bits of this identifier.This property can be used for custom serialization of this identifier. Value of this property can be used with
UuidBase(long, long)
to reconstruct this identifier.- Returns:
- Higher bits of this identifier.
-
loBits
public long loBits()
Returns lower bits of this identifier.This property can be used for custom serialization of this identifier. Value of this property can be used with
UuidBase(long, long)
to reconstruct this identifier.- Returns:
- Lower bits of this identifier.
-
compareTo
public int compareTo(T other)
- Specified by:
compareTo
in interfaceComparable<T extends UuidBase<T>>
-
-