Package com.github.nanoflakes
Interface NanoflakeGenerator
- All Known Implementing Classes:
NanoflakeLocalGenerator
public interface NanoflakeGenerator
A generator of nanoflakes.
-
Method Summary
Modifier and TypeMethodDescriptiondefault OffsetDateTimeepoch()Gets this nanoflake generator's epoch as anOffsetDateTime.longGets this nanoflake generator's epoch.next()Gets the next nanoflake.
-
Method Details
-
next
Nanoflake next()Gets the next nanoflake.- Returns:
- a new, generated nanoflake.
-
epochMillis
long epochMillis()Gets this nanoflake generator's epoch.- Returns:
- the epoch in milliseconds.
-
epoch
Gets this nanoflake generator's epoch as anOffsetDateTime.- Returns:
- a
OffsetDateTimeset to the epoch time.
-