File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,15 @@ public MongoClientOptions build() {
310
310
}
311
311
}
312
312
313
+ /**
314
+ * Create a new Builder instance. This is a convenience method, equivalent to {@code new MongoClientOptions.Builder()}.
315
+ *
316
+ * @return a new instance of a Builder
317
+ */
318
+ public static Builder builder () {
319
+ return new Builder ();
320
+ }
321
+
313
322
/**
314
323
* Gets the description for this MongoClient, which is used in various places like logging and JMX.
315
324
* <p/>
@@ -502,6 +511,8 @@ public boolean isAlwaysUseMBeans() {
502
511
return alwaysUseMBeans ;
503
512
}
504
513
514
+
515
+
505
516
private MongoClientOptions (final Builder builder ) {
506
517
description = builder .description ;
507
518
connectionsPerHost = builder .connectionsPerHost ;
Original file line number Diff line number Diff line change @@ -155,4 +155,9 @@ public DBDecoder create() {
155
155
Assert .assertEquals (encoderFactory , options .getDbEncoderFactory ());
156
156
Assert .assertEquals (decoderFactory , options .getDbDecoderFactory ());
157
157
}
158
+
159
+ @ Test
160
+ public void testStaticBuilderCreate () {
161
+ Assert .assertNotNull (MongoClientOptions .builder ());
162
+ }
158
163
}
You can’t perform that action at this time.
0 commit comments