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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BsonType
getRepresentation()
Gets the BsonRepresentation.Codec<T>
withRepresentation(BsonType representation)
Returns an immutable codec with the given representation.
-
-
-
Method Detail
-
getRepresentation
BsonType getRepresentation()
Gets the BsonRepresentation.- Returns:
- the BsonRepresentation
-
withRepresentation
Codec<T> withRepresentation(BsonType representation)
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
-
-