BsonValueCodecProvider
, DBObjectCodecProvider
, DBRefCodecProvider
, DocumentCodecProvider
, GeoJsonCodecProvider
, GridFSFileCodecProvider
, IterableCodecProvider
, Jsr310CodecProvider
, MapCodecProvider
, PojoCodecProvider
, UuidCodecProvider
, ValueCodecProvider
public interface CodecProvider
Codec
instances. Typically, an instance of a class implementing this interface would be used to construct a
CodecRegistry
.
While the CodecProvider
interface adds no stipulations to the general contract for the Object.equals,
programmers who implement the CodecProvider
interface "directly" must exercise care if they choose to override the
Object.equals
. It is not necessary to do so, and the simplest course of action is to rely on Object's implementation, but the
implementer may wish to implement a "value comparison" in place of the default "reference comparison."
Modifier and Type | Method | Description |
---|---|---|
<T> Codec<T> |
get(Class<T> clazz,
CodecRegistry registry) |
Get a
Codec using the given context, which includes, most importantly, the Class for which a Codec is required. |
<T> Codec<T> get(Class<T> clazz, CodecRegistry registry)
Codec
using the given context, which includes, most importantly, the Class for which a Codec
is required.T
- the type of the class for which a Codec is requiredclazz
- the Class for which to get a Codecregistry
- the registry to use for resolving dependent Codec instances