very minor revision of UuidGenerator jdoc

This commit is contained in:
Gavin King 2023-12-06 16:06:17 +01:00 committed by Steve Ebersole
parent 4a6c26ca4b
commit 9e76f54d06
1 changed files with 11 additions and 6 deletions

View File

@ -16,7 +16,8 @@ import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Specifies that an entity identifier is generated as an RFC 4122 UUID. * Specifies that an entity identifier is generated as an
* <a href=https://datatracker.ietf.org/doc/html/rfc4122>IETF RFC 4122 UUID</a>.
* <p> * <p>
* The type of the identifier attribute may be {@link UUID} or {@link String}. * The type of the identifier attribute may be {@link UUID} or {@link String}.
* *
@ -30,21 +31,25 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Target({ FIELD, METHOD }) @Target({ FIELD, METHOD })
public @interface UuidGenerator { public @interface UuidGenerator {
/**
* Represents a kind of UUID, that is, what RFC 4122 calls a "version".
*/
enum Style { enum Style {
/** /**
* Defaults to {@link #RANDOM}. * Defaults to {@link #RANDOM}.
*/ */
AUTO, AUTO,
/** /**
* Uses {@link UUID#randomUUID()} to generate values. * Use {@link UUID#randomUUID()} to generate UUIDs, producing a value
* compatible with RFC 4122 version 4.
*/ */
RANDOM, RANDOM,
/** /**
* Applies a time-based generation strategy consistent with IETF RFC 4122. * Use a time-based generation strategy consistent with RFC 4122
* Uses IP address rather than MAC address. * version 1, but with IP address instead of MAC address.
* *
* @implNote Can be a bottleneck due to the need to synchronize in order * @implNote Can be a bottleneck, since synchronization is used when
* to increment an internal count as part of the algorithm. * incrementing an internal counter as part of the algorithm.
*/ */
TIME TIME
} }