@@ -74,7 +74,7 @@ public AggregationOptions(boolean allowDiskUse, boolean explain, Document cursor
74
74
* @param allowDiskUse whether to off-load intensive sort-operations to disk.
75
75
* @param explain whether to get the execution plan for the aggregation instead of the actual results.
76
76
* @param cursor can be {@literal null}, used to pass additional options (such as {@code batchSize}) to the
77
- * aggregation.
77
+ * aggregation.
78
78
* @param collation collation for string comparison. Can be {@literal null}.
79
79
* @since 2.0
80
80
*/
@@ -89,13 +89,29 @@ public AggregationOptions(boolean allowDiskUse, boolean explain, @Nullable Docum
89
89
* @param allowDiskUse whether to off-load intensive sort-operations to disk.
90
90
* @param explain whether to get the execution plan for the aggregation instead of the actual results.
91
91
* @param cursor can be {@literal null}, used to pass additional options (such as {@code batchSize}) to the
92
- * aggregation.
92
+ * aggregation.
93
93
* @param collation collation for string comparison. Can be {@literal null}.
94
94
* @param comment execution comment. Can be {@literal null}.
95
- * @param hint can be {@literal null}, used to provide an index that would be forcibly used by query optimizer.
96
95
* @since 2.2
97
96
*/
98
97
public AggregationOptions (boolean allowDiskUse , boolean explain , @ Nullable Document cursor ,
98
+ @ Nullable Collation collation , @ Nullable String comment ) {
99
+ this (allowDiskUse , explain , cursor , collation , comment , null );
100
+ }
101
+
102
+ /**
103
+ * Creates a new {@link AggregationOptions}.
104
+ *
105
+ * @param allowDiskUse whether to off-load intensive sort-operations to disk.
106
+ * @param explain whether to get the execution plan for the aggregation instead of the actual results.
107
+ * @param cursor can be {@literal null}, used to pass additional options (such as {@code batchSize}) to the
108
+ * aggregation.
109
+ * @param collation collation for string comparison. Can be {@literal null}.
110
+ * @param comment execution comment. Can be {@literal null}.
111
+ * @param hint can be {@literal null}, used to provide an index that would be forcibly used by query optimizer.
112
+ * @since 3.1
113
+ */
114
+ private AggregationOptions (boolean allowDiskUse , boolean explain , @ Nullable Document cursor ,
99
115
@ Nullable Collation collation , @ Nullable String comment , @ Nullable Document hint ) {
100
116
101
117
this .allowDiskUse = allowDiskUse ;
@@ -222,12 +238,12 @@ public Optional<String> getComment() {
222
238
* Get the hint used to to fulfill the aggregation.
223
239
*
224
240
* @return never {@literal null}.
241
+ * @since 3.1
225
242
*/
226
243
public Optional <Document > getHint () {
227
244
return hint ;
228
245
}
229
246
230
-
231
247
/**
232
248
* @return the time limit for processing. {@link Duration#ZERO} is used for the default unbounded behavior.
233
249
* @since 3.0
@@ -419,11 +435,11 @@ public Builder comment(@Nullable String comment) {
419
435
}
420
436
421
437
/**
422
- * Define a hint is used forcibly by query optimizer to to fulfill the aggregation.
438
+ * Define a hint that is used by query optimizer to to fulfill the aggregation.
423
439
*
424
440
* @param hint can be {@literal null}.
425
441
* @return this.
426
- * @since 2.2
442
+ * @since 3.1
427
443
*/
428
444
public Builder hint (@ Nullable Document hint ) {
429
445
@@ -435,7 +451,7 @@ public Builder hint(@Nullable Document hint) {
435
451
* Set the time limit for processing.
436
452
*
437
453
* @param maxTime {@link Duration#ZERO} is used for the default unbounded behavior. {@link Duration#isNegative()
438
- * Negative} values will be ignored.
454
+ * Negative} values will be ignored.
439
455
* @return this.
440
456
* @since 3.0
441
457
*/
@@ -466,13 +482,7 @@ public Builder skipOutput() {
466
482
*/
467
483
public AggregationOptions build () {
468
484
469
- AggregationOptions options = new AggregationOptions (
470
- allowDiskUse ,
471
- explain ,
472
- cursor ,
473
- collation ,
474
- comment ,
475
- hint );
485
+ AggregationOptions options = new AggregationOptions (allowDiskUse , explain , cursor , collation , comment , hint );
476
486
if (maxTime != null ) {
477
487
options .maxTime = maxTime ;
478
488
}
0 commit comments