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() {
310310 }
311311 }
312312
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+
313322 /**
314323 * Gets the description for this MongoClient, which is used in various places like logging and JMX.
315324 * <p/>
@@ -502,6 +511,8 @@ public boolean isAlwaysUseMBeans() {
502511 return alwaysUseMBeans ;
503512 }
504513
514+
515+
505516 private MongoClientOptions (final Builder builder ) {
506517 description = builder .description ;
507518 connectionsPerHost = builder .connectionsPerHost ;
Original file line number Diff line number Diff line change @@ -155,4 +155,9 @@ public DBDecoder create() {
155155 Assert .assertEquals (encoderFactory , options .getDbEncoderFactory ());
156156 Assert .assertEquals (decoderFactory , options .getDbDecoderFactory ());
157157 }
158+
159+ @ Test
160+ public void testStaticBuilderCreate () {
161+ Assert .assertNotNull (MongoClientOptions .builder ());
162+ }
158163}
You can’t perform that action at this time.
0 commit comments