- java.lang.Object
-
- com.github.f4b6a3.uuid.factory.UuidFactory
-
- Direct Known Subclasses:
AbstNameBasedFactory,AbstRandomBasedFactory,AbstTimeBasedFactory
public abstract class UuidFactory extends Object
Abstract factory that is base for all UUID factories.
-
-
Field Summary
Fields Modifier and Type Field Description protected UuidVersionversionprotected longversionMask
-
Constructor Summary
Constructors Constructor Description UuidFactory(UuidVersion version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UuidVersiongetVersion()Returns the version number for this factory.protected UUIDtoUuid(long msb, long lsb)Creates a UUID from a pair of numbers.
-
-
-
Field Detail
-
version
protected final UuidVersion version
-
versionMask
protected final long versionMask
-
-
Constructor Detail
-
UuidFactory
public UuidFactory(UuidVersion version)
-
-
Method Detail
-
getVersion
public UuidVersion getVersion()
Returns the version number for this factory.- Returns:
- the version number
-
toUuid
protected UUID toUuid(long msb, long lsb)
Creates a UUID from a pair of numbers.It applies the version and variant numbers to the resulting UUID.
- Parameters:
msb- the most significant bitslsb- the least significant bits- Returns:
- a UUID
-
-