Package com.github.f4b6a3.ulid.factory
Class MonotonicUlidFactory
- java.lang.Object
-
- com.github.f4b6a3.ulid.factory.UlidFactory
-
- com.github.f4b6a3.ulid.factory.MonotonicUlidFactory
-
public final class MonotonicUlidFactory extends UlidFactory
Factory that generates Monotonic ULIDs. The random component is reset to a new value every time the millisecond changes. If more than one ULID is generated within the same millisecond, the random component is incremented by one. The maximum ULIDs that can be generated per millisecond is 2^80.
-
-
Field Summary
-
Fields inherited from class com.github.f4b6a3.ulid.factory.UlidFactory
randomGenerator
-
-
Constructor Summary
Constructors Constructor Description MonotonicUlidFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Ulidcreate(long time)Returns a ULID.-
Methods inherited from class com.github.f4b6a3.ulid.factory.UlidFactory
create, withRandomGenerator
-
-
-
-
Method Detail
-
create
public Ulid create(long time)
Returns a ULID.- Specified by:
createin classUlidFactory- Parameters:
time- a specific time- Returns:
- a ULID
-
-