Update README.md
This commit is contained in:
parent
3331ca94c1
commit
d1b8ba9d07
|
@ -115,25 +115,25 @@ Examples of ULIDs:
|
||||||
These are some examples of using the `UlidSpecCreator` to create ULIDs strings:
|
These are some examples of using the `UlidSpecCreator` to create ULIDs strings:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
|
||||||
// with your custom timestamp strategy
|
// with your custom timestamp strategy
|
||||||
TimestampStrategy customStrategy = new CustomTimestampStrategy();
|
TimestampStrategy customStrategy = new CustomTimestampStrategy();
|
||||||
String ulid = UlidCreator.getUlidSpecCreator()
|
String ulid = UlidCreator.getUlidSpecCreator()
|
||||||
.withTimestampStrategy(customStrategy)
|
.withTimestampStrategy(customStrategy)
|
||||||
.createString();
|
.createString();
|
||||||
|
```java
|
||||||
|
```
|
||||||
// with your custom random strategy that wraps any random generator
|
// with your custom random strategy that wraps any random generator
|
||||||
RandomStrategy customStrategy = new CustomRandomStrategy();
|
RandomStrategy customStrategy = new CustomRandomStrategy();
|
||||||
String ulid = UlidCreator.getUlidSpecCreator()
|
String ulid = UlidCreator.getUlidSpecCreator()
|
||||||
.withRandomStrategy(customStrategy)
|
.withRandomStrategy(customStrategy)
|
||||||
.createString();
|
.createString();
|
||||||
|
```java
|
||||||
|
```
|
||||||
// with `java.util.Random` number generator
|
// with `java.util.Random` number generator
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
String ulid = UlidCreator.getUlidSpecCreator()
|
String ulid = UlidCreator.getUlidSpecCreator()
|
||||||
.withRandomGenerator(random)
|
.withRandomGenerator(random)
|
||||||
.createString();
|
.createString();
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue