19
19
import com .mongodb .MongoNamespace ;
20
20
import com .mongodb .client .model .densify .DensifyOptions ;
21
21
import com .mongodb .client .model .densify .DensifyRange ;
22
- import com .mongodb .client .model .fill .FillComputation ;
22
+ import com .mongodb .client .model .fill .FillOutputField ;
23
23
import com .mongodb .client .model .fill .FillOptions ;
24
24
import com .mongodb .client .model .search .SearchOperator ;
25
25
import com .mongodb .client .model .search .SearchCollector ;
@@ -624,16 +624,16 @@ public static Bson sample(final int size) {
624
624
* Sorting is required by certain functions and may be required by some windows (see {@link Windows} for more details).
625
625
* Sorting is used only for the purpose of computing window functions and does not guarantee ordering
626
626
* of the output documents.
627
- * @param output A {@linkplain WindowedComputation windowed computation}.
628
- * @param moreOutput More {@linkplain WindowedComputation windowed computations}.
627
+ * @param output A {@linkplain WindowOutputField windowed computation}.
628
+ * @param moreOutput More {@linkplain WindowOutputField windowed computations}.
629
629
* @param <TExpression> The {@code partitionBy} expression type.
630
630
* @return The {@code $setWindowFields} pipeline stage.
631
631
* @mongodb.driver.dochub core/window-functions-set-window-fields $setWindowFields
632
632
* @mongodb.server.release 5.0
633
633
* @since 4.3
634
634
*/
635
635
public static <TExpression > Bson setWindowFields (@ Nullable final TExpression partitionBy , @ Nullable final Bson sortBy ,
636
- final WindowedComputation output , final WindowedComputation ... moreOutput ) {
636
+ final WindowOutputField output , final WindowOutputField ... moreOutput ) {
637
637
return setWindowFields (partitionBy , sortBy , concat (notNull ("output" , output ), moreOutput ));
638
638
}
639
639
@@ -650,7 +650,7 @@ public static <TExpression> Bson setWindowFields(@Nullable final TExpression par
650
650
* Sorting is required by certain functions and may be required by some windows (see {@link Windows} for more details).
651
651
* Sorting is used only for the purpose of computing window functions and does not guarantee ordering
652
652
* of the output documents.
653
- * @param output A list of {@linkplain WindowedComputation windowed computations}.
653
+ * @param output A list of {@linkplain WindowOutputField windowed computations}.
654
654
* Specifying an empty list is not an error, but the resulting stage does not do anything useful.
655
655
* @param <TExpression> The {@code partitionBy} expression type.
656
656
* @return The {@code $setWindowFields} pipeline stage.
@@ -659,7 +659,7 @@ public static <TExpression> Bson setWindowFields(@Nullable final TExpression par
659
659
* @since 4.3
660
660
*/
661
661
public static <TExpression > Bson setWindowFields (@ Nullable final TExpression partitionBy , @ Nullable final Bson sortBy ,
662
- final Iterable <? extends WindowedComputation > output ) {
662
+ final Iterable <? extends WindowOutputField > output ) {
663
663
notNull ("output" , output );
664
664
return new SetWindowFieldsStage <>(partitionBy , sortBy , output );
665
665
}
@@ -722,28 +722,28 @@ public String toString() {
722
722
* Creates a {@code $fill} pipeline stage, which assigns values to fields when they are {@link BsonType#NULL Null} or missing.
723
723
*
724
724
* @param options The fill options.
725
- * @param output The {@link FillComputation }.
726
- * @param moreOutput More {@link FillComputation }s.
725
+ * @param output The {@link FillOutputField }.
726
+ * @param moreOutput More {@link FillOutputField }s.
727
727
* @return The requested pipeline stage.
728
728
* @mongodb.driver.manual reference/operator/aggregation/fill/ $fill
729
729
* @mongodb.server.release 5.3
730
730
* @since 4.7
731
731
*/
732
- public static Bson fill (final FillOptions options , final FillComputation output , final FillComputation ... moreOutput ) {
732
+ public static Bson fill (final FillOptions options , final FillOutputField output , final FillOutputField ... moreOutput ) {
733
733
return fill (options , concat (notNull ("output" , output ), moreOutput ));
734
734
}
735
735
736
736
/**
737
737
* Creates a {@code $fill} pipeline stage, which assigns values to fields when they are {@link BsonType#NULL Null} or missing.
738
738
*
739
739
* @param options The fill options.
740
- * @param output The non-empty {@link FillComputation }s.
740
+ * @param output The non-empty {@link FillOutputField }s.
741
741
* @return The requested pipeline stage.
742
742
* @mongodb.driver.manual reference/operator/aggregation/fill/ $fill
743
743
* @mongodb.server.release 5.3
744
744
* @since 4.7
745
745
*/
746
- public static Bson fill (final FillOptions options , final Iterable <? extends FillComputation > output ) {
746
+ public static Bson fill (final FillOptions options , final Iterable <? extends FillOutputField > output ) {
747
747
notNull ("options" , options );
748
748
notNull ("output" , output );
749
749
isTrueArgument ("output must not be empty" , sizeAtLeast (output , 1 ));
@@ -753,7 +753,7 @@ public <TDocument> BsonDocument toBsonDocument(final Class<TDocument> documentCl
753
753
BsonDocument fillSpecificationDoc = new BsonDocument ();
754
754
fillSpecificationDoc .putAll (options .toBsonDocument (documentClass , codecRegistry ));
755
755
BsonDocument outputDoc = new BsonDocument ();
756
- for (final FillComputation computation : output ) {
756
+ for (final FillOutputField computation : output ) {
757
757
BsonDocument computationDoc = computation .toBsonDocument (documentClass , codecRegistry );
758
758
assertTrue (computationDoc .size () == 1 );
759
759
outputDoc .putAll (computationDoc );
@@ -1821,12 +1821,12 @@ private static final class SetWindowFieldsStage<TExpression> implements Bson {
1821
1821
private final TExpression partitionBy ;
1822
1822
@ Nullable
1823
1823
private final Bson sortBy ;
1824
- private final Iterable <? extends WindowedComputation > output ;
1824
+ private final Iterable <? extends WindowOutputField > output ;
1825
1825
1826
1826
SetWindowFieldsStage (
1827
1827
@ Nullable final TExpression partitionBy ,
1828
1828
@ Nullable final Bson sortBy ,
1829
- final Iterable <? extends WindowedComputation > output ) {
1829
+ final Iterable <? extends WindowOutputField > output ) {
1830
1830
this .partitionBy = partitionBy ;
1831
1831
this .sortBy = sortBy ;
1832
1832
this .output = output ;
@@ -1846,8 +1846,8 @@ public <TDocument> BsonDocument toBsonDocument(final Class<TDocument> tDocumentC
1846
1846
BuildersHelper .encodeValue (writer , sortBy , codecRegistry );
1847
1847
}
1848
1848
writer .writeStartDocument ("output" );
1849
- for (WindowedComputation windowedComputation : output ) {
1850
- BsonField field = windowedComputation .toBsonField ();
1849
+ for (WindowOutputField windowOutputField : output ) {
1850
+ BsonField field = windowOutputField .toBsonField ();
1851
1851
writer .writeName (field .getName ());
1852
1852
BuildersHelper .encodeValue (writer , field .getValue (), codecRegistry );
1853
1853
}
0 commit comments