Package org.bson
Enum Class UuidRepresentation
- All Implemented Interfaces:
Serializable
,Comparable<UuidRepresentation>
,java.lang.constant.Constable
The representation to use when converting a UUID to a BSON binary value.
This class is necessary because the different drivers used to have different
ways of encoding UUID, with the BSON subtype: \x03 UUID old.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe legacy representation of UUID used by the C# driverThe legacy representation of UUID used by the Java driverThe legacy representation of UUID used by the Python driver, which is the same format as STANDARD, but has the UUID old BSON subtype (\x03)The canonical representation of UUIDAn unspecified representation of UUID. -
Method Summary
Modifier and TypeMethodDescriptionGets the BSON binary subtype for the representation.static UuidRepresentation
Returns the enum constant of this class with the specified name.static UuidRepresentation[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNSPECIFIED
An unspecified representation of UUID. Essentially, this is the null representation value.- Since:
- 3.12
-
STANDARD
The canonical representation of UUIDBSON binary subtype 4
-
C_SHARP_LEGACY
The legacy representation of UUID used by the C# driverBSON binary subtype 3
-
JAVA_LEGACY
The legacy representation of UUID used by the Java driverBSON binary subtype 3
-
PYTHON_LEGACY
The legacy representation of UUID used by the Python driver, which is the same format as STANDARD, but has the UUID old BSON subtype (\x03)BSON binary subtype 3
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getSubtype
Gets the BSON binary subtype for the representation.- Returns:
- the BSON binary subtype for the representation
- Throws:
BSONException
- if this isUNSPECIFIED
- Since:
- 4.7
-