diff --git a/bson/src/main/org/bson/BinaryVector.java b/bson/src/main/org/bson/BinaryVector.java index a1914601a9..f5d57f5b24 100644 --- a/bson/src/main/org/bson/BinaryVector.java +++ b/bson/src/main/org/bson/BinaryVector.java @@ -32,6 +32,9 @@ * @since 5.3 */ public abstract class BinaryVector { + /** + * The BinaryVector logger + */ protected static final Logger LOGGER = Loggers.getLogger("BinaryVector"); private final DataType dataType; diff --git a/bson/src/main/org/bson/BsonBinary.java b/bson/src/main/org/bson/BsonBinary.java index 833a1b5ad2..0ece148eb2 100644 --- a/bson/src/main/org/bson/BsonBinary.java +++ b/bson/src/main/org/bson/BsonBinary.java @@ -127,9 +127,14 @@ public BsonBinary(final UUID uuid, final UuidRepresentation uuidRepresentation) } /** - * Returns the binary as a UUID. The binary type must be 4. + * Returns the binary as a UUID. + * + *
Note:The BsonBinary subtype must be {@link BsonBinarySubType#UUID_STANDARD}.
* * @return the uuid + * @throws BsonInvalidOperationException if BsonBinary subtype is not {@link BsonBinarySubType#UUID_STANDARD} + * @see #asUuid(UuidRepresentation) + * @see BsonBinarySubType * @since 3.9 */ public UUID asUuid() { @@ -162,8 +167,15 @@ public BinaryVector asVector() { /** * Returns the binary as a UUID. * - * @param uuidRepresentation the UUID representation + *Note:The BsonBinary subtype must be either {@link BsonBinarySubType#UUID_STANDARD} or + * {@link BsonBinarySubType#UUID_LEGACY}.
+ * + * @param uuidRepresentation the UUID representation, must be {@link UuidRepresentation#STANDARD} or + * {@link UuidRepresentation#JAVA_LEGACY} * @return the uuid + * @throws BsonInvalidOperationException if the BsonBinary subtype is incompatible with the given {@code uuidRepresentation}, or if + * the {@code uuidRepresentation} is not {@link UuidRepresentation#STANDARD} or + * {@link UuidRepresentation#JAVA_LEGACY}. * @since 3.9 */ public UUID asUuid(final UuidRepresentation uuidRepresentation) { diff --git a/bson/src/main/org/bson/BsonBinarySubType.java b/bson/src/main/org/bson/BsonBinarySubType.java index 08c29e2ef0..2a6eed1f5d 100644 --- a/bson/src/main/org/bson/BsonBinarySubType.java +++ b/bson/src/main/org/bson/BsonBinarySubType.java @@ -93,7 +93,7 @@ public enum BsonBinarySubType { * Returns true if the given value is a UUID subtype. * * @param value the subtype value as a byte. - * @return true if value is a UUID subtype. + * @return true if value has a {@link #UUID_STANDARD} or {@link #UUID_LEGACY} subtype. * @since 3.4 */ public static boolean isUuid(final byte value) {