Package com.github.nanoflakes
Class NanoflakeLocalGenerator
java.lang.Object
com.github.nanoflakes.NanoflakeLocalGenerator
- All Implemented Interfaces:
NanoflakeGenerator
A local generator of nanoflakes.
-
Constructor Summary
ConstructorsConstructorDescriptionNanoflakeLocalGenerator(long epoch, long generatorId)Creates a new local generator of nanoflakes. -
Method Summary
Methods inherited from interface com.github.nanoflakes.NanoflakeGenerator
epoch
-
Constructor Details
-
NanoflakeLocalGenerator
public NanoflakeLocalGenerator(long epoch, long generatorId)Creates a new local generator of nanoflakes.- Parameters:
epoch- the generator's epoch.generatorId- the generator's ID.
-
-
Method Details
-
next
Gets the next nanoflake.- Specified by:
nextin interfaceNanoflakeGenerator- Returns:
- a new, generated nanoflake.
-
epochMillis
public long epochMillis()Gets this nanoflake generator's epoch.- Specified by:
epochMillisin interfaceNanoflakeGenerator- Returns:
- the epoch in milliseconds.
-
equals
-
hashCode
public int hashCode() -
toString
-