Package org.bson.codecs
Interface RepresentationConfigurable<T>
- Type Parameters:
T
- the value type
- All Known Implementing Classes:
StringCodec
public interface RepresentationConfigurable<T>
Implementations of this interface can decode additional types
and translate them to the desired value type depending on the BsonRepresentation.
- Since:
- 4.2
-
Method Summary
Modifier and TypeMethodDescriptionGets the BsonRepresentation.withRepresentation
(BsonType representation) Returns an immutable codec with the given representation.
-
Method Details
-
getRepresentation
BsonType getRepresentation()Gets the BsonRepresentation.- Returns:
- the BsonRepresentation
-
withRepresentation
Returns an immutable codec with the given representation. If the provided representation is not supported an exception will be thrown.- Parameters:
representation
- the BsonRepresentation.- Returns:
- a new Codec with the correct representation.
- Throws:
CodecConfigurationException
- if the codec does not support the provided representation
-