Package org.bson.codecs
Class OverridableUuidRepresentationUuidCodec
- java.lang.Object
 - 
- org.bson.codecs.UuidCodec
 - 
- org.bson.codecs.OverridableUuidRepresentationUuidCodec
 
 
 
- 
- All Implemented Interfaces:
 Codec<UUID>,Decoder<UUID>,Encoder<UUID>,OverridableUuidRepresentationCodec<UUID>
public class OverridableUuidRepresentationUuidCodec extends UuidCodec implements OverridableUuidRepresentationCodec<UUID>
An extension ofUuidCodecthat allows its configuredUuidRepresentationto be overridden by an externally configuredUuidRepresentation, most likely configured onMongoClientSettingsorMongoClientOptions.- Since:
 - 3.12
 
 
- 
- 
Constructor Summary
Constructors Constructor Description OverridableUuidRepresentationUuidCodec()Construct an instance with the default UUID representation.OverridableUuidRepresentationUuidCodec(UuidRepresentation uuidRepresentation)Construct an instance with the given UUID representation. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Codec<UUID>withUuidRepresentation(UuidRepresentation uuidRepresentation)Implementations must return a new instance with theUuidRepresentationoverridden with the given value.- 
Methods inherited from class org.bson.codecs.UuidCodec
decode, encode, getEncoderClass, getUuidRepresentation, toString 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
OverridableUuidRepresentationUuidCodec
public OverridableUuidRepresentationUuidCodec()
Construct an instance with the default UUID representation. 
- 
OverridableUuidRepresentationUuidCodec
public OverridableUuidRepresentationUuidCodec(UuidRepresentation uuidRepresentation)
Construct an instance with the given UUID representation.- Parameters:
 uuidRepresentation- the UUID representation
 
 - 
 
- 
Method Detail
- 
withUuidRepresentation
public Codec<UUID> withUuidRepresentation(UuidRepresentation uuidRepresentation)
Description copied from interface:OverridableUuidRepresentationCodecImplementations must return a new instance with theUuidRepresentationoverridden with the given value.- Specified by:
 withUuidRepresentationin interfaceOverridableUuidRepresentationCodec<UUID>- Parameters:
 uuidRepresentation- the UuidRepresentation- Returns:
 - a new instance equivalent to this but with the given UuidRepresentation
 
 
 - 
 
 -