Package com.github.nanoflakes

Types

DateTime
Link copied to clipboard
common
class DateTime
This class should either be a typealias for a system-dependent Date and Time class or implement one if needed.
typealias DateTime = Date
typealias DateTime = OffsetDateTime
Nanoflake
Link copied to clipboard
common
class Nanoflake
NanoflakeGenerator
Link copied to clipboard
common
interface NanoflakeGenerator
A generator of nanoflakes.
NanoflakeLocalGenerator
Link copied to clipboard
common
class NanoflakeLocalGenerator(epoch: Long, generatorId: Long) : NanoflakeGenerator
A local generator of nanoflakes.
Nanoflakes
Link copied to clipboard
common
object Nanoflakes
Utility methods and constants related to Nanoflakes.

Functions

currentTimeMillis
Link copied to clipboard
common
fun currentTimeMillis(): Long
This function provides the current time in milliseconds to the local generator.
fun currentTimeMillis(): Long
fun currentTimeMillis(): Long
maybeSynchronized
Link copied to clipboard
common
inline fun <R> maybeSynchronized(lock: Any, block: () -> R): R
This function provides optional synchronization for platforms with multithreading.
inline fun <R> maybeSynchronized(lock: Any, block: () -> R): R
inline fun <R> maybeSynchronized(lock: Any, block: () -> R): R
toDateTime
Link copied to clipboard
common
fun Long.toDateTime(): DateTime
This function converts a Long for the system's dependent Date and Time class.
fun Long.toDateTime(): DateTime
fun Long.toDateTime(): DateTime