Update README.md

This commit is contained in:
Fábio Lima 2020-07-05 00:49:48 -03:00 committed by GitHub
parent 3331ca94c1
commit d1b8ba9d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -115,25 +115,25 @@ Examples of ULIDs:
These are some examples of using the `UlidSpecCreator` to create ULIDs strings:
```java
// with your custom timestamp strategy
TimestampStrategy customStrategy = new CustomTimestampStrategy();
String ulid = UlidCreator.getUlidSpecCreator()
.withTimestampStrategy(customStrategy)
.createString();
```java
```
// with your custom random strategy that wraps any random generator
RandomStrategy customStrategy = new CustomRandomStrategy();
String ulid = UlidCreator.getUlidSpecCreator()
.withRandomStrategy(customStrategy)
.createString();
```java
```
// with `java.util.Random` number generator
Random random = new Random();
String ulid = UlidCreator.getUlidSpecCreator()
.withRandomGenerator(random)
.createString();
```