File tree Expand file tree Collapse file tree 7 files changed +44
-0
lines changed
driver-core/src/main/com/mongodb
driver-reactive-streams/src/main/com/mongodb/reactivestreams/client
driver-scala/src/main/scala/org/mongodb/scala
driver-sync/src/main/com/mongodb/client Expand file tree Collapse file tree 7 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -400,9 +400,15 @@ public Builder credential(final MongoCredential credential) {
400
400
/**
401
401
* Sets the codec registry
402
402
*
403
+ * <p>The {@link CodecRegistry} configured by this method is effectively treated by the driver as an instance of
404
+ * {@link org.bson.codecs.configuration.CodecProvider}, which {@link CodecRegistry} extends. So there is no benefit to defining
405
+ * a class that implements {@link CodecRegistry}. Rather, an application should always create {@link CodecRegistry} instances
406
+ * using the factory methods in {@link org.bson.codecs.configuration.CodecRegistries}.</p>
407
+ *
403
408
* @param codecRegistry the codec registry
404
409
* @return this
405
410
* @see MongoClientSettings#getCodecRegistry()
411
+ * @see org.bson.codecs.configuration.CodecRegistries
406
412
*/
407
413
public Builder codecRegistry (final CodecRegistry codecRegistry ) {
408
414
this .codecRegistry = notNull ("codecRegistry" , codecRegistry );
Original file line number Diff line number Diff line change @@ -118,8 +118,14 @@ public interface MongoCollection<TDocument> {
118
118
/**
119
119
* Create a new MongoCollection instance with a different codec registry.
120
120
*
121
+ * <p>The {@link CodecRegistry} configured by this method is effectively treated by the driver as an instance of
122
+ * {@link org.bson.codecs.configuration.CodecProvider}, which {@link CodecRegistry} extends. So there is no benefit to defining
123
+ * a class that implements {@link CodecRegistry}. Rather, an application should always create {@link CodecRegistry} instances
124
+ * using the factory methods in {@link org.bson.codecs.configuration.CodecRegistries}.</p>
125
+ *
121
126
* @param codecRegistry the new {@link org.bson.codecs.configuration.CodecRegistry} for the collection
122
127
* @return a new MongoCollection instance with the different codec registry
128
+ * @see org.bson.codecs.configuration.CodecRegistries
123
129
*/
124
130
MongoCollection <TDocument > withCodecRegistry (CodecRegistry codecRegistry );
125
131
Original file line number Diff line number Diff line change @@ -77,8 +77,14 @@ public interface MongoDatabase {
77
77
/**
78
78
* Create a new MongoDatabase instance with a different codec registry.
79
79
*
80
+ * <p>The {@link CodecRegistry} configured by this method is effectively treated by the driver as an instance of
81
+ * {@link org.bson.codecs.configuration.CodecProvider}, which {@link CodecRegistry} extends. So there is no benefit to defining
82
+ * a class that implements {@link CodecRegistry}. Rather, an application should always create {@link CodecRegistry} instances
83
+ * using the factory methods in {@link org.bson.codecs.configuration.CodecRegistries}.</p>
84
+ *
80
85
* @param codecRegistry the new {@link org.bson.codecs.configuration.CodecRegistry} for the collection
81
86
* @return a new MongoDatabase instance with the different codec registry
87
+ * @see org.bson.codecs.configuration.CodecRegistries
82
88
*/
83
89
MongoDatabase withCodecRegistry (CodecRegistry codecRegistry );
84
90
Original file line number Diff line number Diff line change @@ -96,8 +96,15 @@ case class MongoCollection[TResult](private val wrapped: JMongoCollection[TResul
96
96
/**
97
97
* Create a new MongoCollection instance with a different codec registry.
98
98
*
99
+ * The { @link CodecRegistry} configured by this method is effectively treated by the driver as an
100
+ * instance of { @link CodecProvider}, which { @link CodecRegistry} extends.
101
+ * So there is no benefit to defining a class that implements { @link CodecRegistry}. Rather, an
102
+ * application should always create { @link CodecRegistry} instances using the factory methods in
103
+ * { @link CodecRegistries}.
104
+ *
99
105
* @param codecRegistry the new { @link org.bson.codecs.configuration.CodecRegistry} for the collection
100
106
* @return a new MongoCollection instance with the different codec registry
107
+ * @see CodecRegistries
101
108
*/
102
109
def withCodecRegistry (codecRegistry : CodecRegistry ): MongoCollection [TResult ] =
103
110
MongoCollection (wrapped.withCodecRegistry(codecRegistry))
Original file line number Diff line number Diff line change @@ -72,8 +72,15 @@ case class MongoDatabase(private[scala] val wrapped: JMongoDatabase) {
72
72
/**
73
73
* Create a new MongoDatabase instance with a different codec registry.
74
74
*
75
+ * The { @link CodecRegistry} configured by this method is effectively treated by the driver as an
76
+ * instance of { @link CodecProvider}, which { @link CodecRegistry} extends.
77
+ * So there is no benefit to defining a class that implements { @link CodecRegistry}. Rather, an
78
+ * application should always create { @link CodecRegistry} instances using the factory methods in
79
+ * { @link CodecRegistries}.
80
+ *
75
81
* @param codecRegistry the new { @link org.bson.codecs.configuration.CodecRegistry} for the collection
76
82
* @return a new MongoDatabase instance with the different codec registry
83
+ * @see CodecRegistries
77
84
*/
78
85
def withCodecRegistry (codecRegistry : CodecRegistry ): MongoDatabase =
79
86
MongoDatabase (wrapped.withCodecRegistry(codecRegistry))
Original file line number Diff line number Diff line change @@ -123,8 +123,14 @@ public interface MongoCollection<TDocument> {
123
123
/**
124
124
* Create a new MongoCollection instance with a different codec registry.
125
125
*
126
+ * <p>The {@link CodecRegistry} configured by this method is effectively treated by the driver as an instance of
127
+ * {@link org.bson.codecs.configuration.CodecProvider}, which {@link CodecRegistry} extends. So there is no benefit to defining
128
+ * a class that implements {@link CodecRegistry}. Rather, an application should always create {@link CodecRegistry} instances
129
+ * using the factory methods in {@link org.bson.codecs.configuration.CodecRegistries}.</p>
130
+ *
126
131
* @param codecRegistry the new {@link org.bson.codecs.configuration.CodecRegistry} for the collection
127
132
* @return a new MongoCollection instance with the different codec registry
133
+ * @see org.bson.codecs.configuration.CodecRegistries
128
134
*/
129
135
MongoCollection <TDocument > withCodecRegistry (CodecRegistry codecRegistry );
130
136
Original file line number Diff line number Diff line change @@ -79,8 +79,14 @@ public interface MongoDatabase {
79
79
/**
80
80
* Create a new MongoDatabase instance with a different codec registry.
81
81
*
82
+ * <p>The {@link CodecRegistry} configured by this method is effectively treated by the driver as an instance of
83
+ * {@link org.bson.codecs.configuration.CodecProvider}, which {@link CodecRegistry} extends. So there is no benefit to defining
84
+ * a class that implements {@link CodecRegistry}. Rather, an application should always create {@link CodecRegistry} instances
85
+ * using the factory methods in {@link org.bson.codecs.configuration.CodecRegistries}.</p>
86
+ *
82
87
* @param codecRegistry the new {@link org.bson.codecs.configuration.CodecRegistry} for the database
83
88
* @return a new MongoDatabase instance with the different codec registry
89
+ * @see org.bson.codecs.configuration.CodecRegistries
84
90
*/
85
91
MongoDatabase withCodecRegistry (CodecRegistry codecRegistry );
86
92
You can’t perform that action at this time.
0 commit comments