Skip to content

Commit fa08798

Browse files
committed
Update release notes, javadocs, version references
1 parent 9ba8ce8 commit fa08798

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ UUID uuid = Generators.nameBasedgenerator().generate("string to hash"); // Versi
6767
// With JUG 4.1+: support for https://github.com/uuid6/uuid6-ietf-draft versions 6 and 7:
6868
UUID uuid = Generators.timeBasedReorderedGenerator().generate(); // Version 6
6969
UUID uuid = Generators.timeBasedEpochGenerator().generate(); // Version 7
70-
UUID uuid = Generators.timeBasedEpochRandomGenerator().generate(); // Version 7 with random values
70+
UUID uuid = Generators.timeBasedEpochRandomGenerator().generate(); // Version 7 with per-call random values
7171
```
7272

7373
If you want customize generators, you may also just want to hold on to generator instance:

release-notes/VERSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Releases
1313
(contributed by @magdel)
1414
#85: Fix `LazyRandom` for native code generation tools
1515
(contributed by @Maia-Everett)
16+
#94: Add alternate version to UUIDv7 generator that uses random values on every
17+
call (not just for different timestamp)
18+
(contributed by @magdel)
1619

1720
4.3.0 (12-Sep-2023)
1821

src/main/java/com/fasterxml/uuid/Generators.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ public static TimeBasedEpochGenerator timeBasedEpochGenerator()
136136
* Factory method for constructing UUID generator that generates UUID using
137137
* version 7 (Unix Epoch time+random based), using specified {@link Random}
138138
* number generator.
139-
* Calls within same millisecond produce very similar values what may be
139+
*<p>
140+
* NOTE: calls within same millisecond produce very similar values; this may be
140141
* unsafe in some environments.
142+
*<p>
141143
* No additional external synchronization is used.
142144
*/
143145
public static TimeBasedEpochGenerator timeBasedEpochGenerator(Random random)
@@ -149,9 +151,11 @@ public static TimeBasedEpochGenerator timeBasedEpochGenerator(Random random)
149151
* Factory method for constructing UUID generator that generates UUID using
150152
* version 7 (Unix Epoch time+random based), using specified {@link Random}
151153
* number generator.
152-
* Timestamp to use is accessed using specified {@link UUIDClock}
153-
* Calls within same millisecond produce very similar values what may be
154+
* Timestamp to use is accessed using specified {@link UUIDClock}.
155+
*<p>
156+
* NOTE: calls within same millisecond produce very similar values; this may be
154157
* unsafe in some environments.
158+
*<p>
155159
* No additional external synchronization is used.
156160
*
157161
* @since 4.3
@@ -166,8 +170,13 @@ public static TimeBasedEpochGenerator timeBasedEpochGenerator(Random random,
166170
* Factory method for constructing UUID generator that generates UUID using
167171
* version 7 (Unix Epoch time+random based), using specified {@link Random}
168172
* number generator.
169-
* Calls within same millisecond produce as random as possible values.
173+
*<p>
174+
* Calls within same millisecond use additional per-call randomness to try to create
175+
* more distinct values, compared to {@link #timeBasedEpochGenerator(Random)}
176+
*<p>
170177
* No additional external synchronization is used.
178+
*
179+
* @since 5.0
171180
*/
172181
public static TimeBasedEpochRandomGenerator timeBasedEpochRandomGenerator(Random random)
173182
{
@@ -177,13 +186,15 @@ public static TimeBasedEpochRandomGenerator timeBasedEpochRandomGenerator(Random
177186
/**
178187
* Factory method for constructing UUID generator that generates UUID using
179188
* version 7 (Unix Epoch time+random based), using specified {@link Random}
180-
* number generato.
189+
* number generator.
181190
* Timestamp to use is accessed using specified {@link UUIDClock}
182-
* Calls within same millisecond produce as random as possible values.
183-
*
191+
*<p>
192+
* Calls within same millisecond use additional per-call randomness to try to create
193+
* more distinct values, compared to {@link #timeBasedEpochGenerator(Random)}
194+
*<p>
184195
* No additional external synchronization is used.
185196
*
186-
* @since 4.3
197+
* @since 5.0
187198
*/
188199
public static TimeBasedEpochRandomGenerator timeBasedEpochRandomGenerator(Random random,
189200
UUIDClock clock)

src/main/java/com/fasterxml/uuid/impl/TimeBasedEpochRandomGenerator.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* {@link com.fasterxml.uuid.ext.FileBasedTimestampSynchronizer} (or
2626
* equivalent).
2727
*
28-
* @since 4.1
28+
* @since 5.0
2929
*/
3030
public class TimeBasedEpochRandomGenerator extends NoArgGenerator
3131
{
@@ -45,8 +45,6 @@ public class TimeBasedEpochRandomGenerator extends NoArgGenerator
4545
/**
4646
* Underlying {@link UUIDClock} used for accessing current time, to use for
4747
* generation.
48-
*
49-
* @since 4.3
5048
*/
5149
protected final UUIDClock _clock;
5250

@@ -117,8 +115,6 @@ public UUID generate()
117115
* @param rawTimestamp unix epoch millis
118116
*
119117
* @return unix epoch time based UUID
120-
*
121-
* @since 4.3
122118
*/
123119
public UUID construct(long rawTimestamp)
124120
{

src/main/java/com/fasterxml/uuid/impl/UUIDUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ private final static void _checkUUIDByteArray(byte[] bytes, int offset)
362362
*
363363
* @return timestamp in milliseconds (since Epoch), or 0 if type does not support timestamps
364364
*
365-
* @since 5.0.0
365+
* @since 5.0
366366
*/
367367
public static long extractTimestamp(UUID uuid)
368368
{

0 commit comments

Comments
 (0)