@@ -218,7 +218,6 @@ public static Field field(FieldPath fieldPath) {
218218 return Field .ofUserPath (fieldPath .toString ());
219219 }
220220
221-
222221 /**
223222 * Creates an expression that returns the current timestamp.
224223 *
@@ -229,7 +228,6 @@ public static Expression currentTimestamp() {
229228 return new FunctionExpression ("current_timestamp" , ImmutableList .of ());
230229 }
231230
232-
233231 /**
234232 * Creates an expression that returns a default value if an expression evaluates to an absent
235233 * value.
@@ -4811,8 +4809,7 @@ public static Expression currentDocument() {
48114809 }
48124810
48134811 /**
4814- * Creates an expression that retrieves the value of a variable bound via {@link
4815- * Pipeline#define(AliasedExpression, AliasedExpression...)}.
4812+ * Creates an expression that retrieves the value of a variable bound via pipeline definitions.
48164813 *
48174814 * @param name The name of the variable to retrieve.
48184815 * @return An {@link Expression} representing the variable's value.
@@ -4823,97 +4820,33 @@ public static Expression variable(String name) {
48234820 }
48244821
48254822 /**
4826- * Creates an expression that evaluates to the provided pipeline.
4827- *
4828- * @param pipeline The pipeline to use as an expression.
4829- * @return A new {@link Expression} representing the pipeline value.
4830- */
4831- @ InternalApi
4832- public static Expression pipeline (Pipeline pipeline ) {
4833- return new PipelineValueExpression (pipeline );
4834- }
4835-
4836- /**
4837- * Accesses a field/property of the expression (useful when the expression
4838- * evaluates to a Map or
4823+ * Accesses a field/property of the expression (useful when the expression evaluates to a Map or
48394824 * Document).
48404825 *
4826+ * @param expression The expression evaluating to a map/document.
48414827 * @param key The key of the field to access.
48424828 * @return An {@link Expression} representing the value of the field.
48434829 */
48444830 @ BetaApi
4845- public Expression getField (String key ) {
4846- return new FunctionExpression ("field" , ImmutableList .of (this , constant (key )));
4847- }
4848-
4849- /**
4850- * Retrieves the value of a specific field from the document evaluated by this
4851- * expression.
4852- *
4853- * @param keyExpression The expression evaluating to the key to access.
4854- * @return A new {@link Expression} representing the field value.
4855- */
4856- @ BetaApi
4857- public Expression getField (Expression keyExpression ) {
4858- return new FunctionExpression ("field" , ImmutableList .of (this , keyExpression ));
4859- }
4860-
4861- /**
4862- * Accesses a field/property of a document field using the provided {@code key}.
4863- *
4864- * @param fieldName The field name of the map or document field.
4865- * @param key The key of the field to access.
4866- * @return An {@link Expression} representing the value of the field.
4867- */
4868- @ BetaApi
4869- public static Expression getField (String fieldName , String key ) {
4870- return field (fieldName ).getField (key );
4871- }
4872-
4873- /**
4874- * Accesses a field/property of the expression using the provided
4875- * {@code keyExpression}.
4876- *
4877- * @param expression The expression evaluating to a Map or Document.
4878- * @param keyExpression The expression evaluating to the key.
4879- * @return A new {@link Expression} representing the value of the field.
4880- */
4881- @ BetaApi
4882- public static Expression getField (Expression expression , Expression keyExpression ) {
4883- return expression .getField (keyExpression );
4884- }
4885-
4886- /**
4887- * Accesses a field/property of a document field using the provided
4888- * {@code keyExpression}.
4889- *
4890- * @param fieldName The field name of the map or document field.
4891- * @param keyExpression The expression evaluating to the key.
4892- * @return A new {@link Expression} representing the value of the field.
4893- */
4894- @ BetaApi
4895- public static Expression getField (String fieldName , Expression keyExpression ) {
4896- return field (fieldName ).getField (keyExpression );
4831+ public static Expression field (Expression expression , String key ) {
4832+ return new FunctionExpression ("field" , ImmutableList .of (expression , constant (key )));
48974833 }
48984834
48994835 /**
4900- * Accesses a field/property of the expression (useful when the expression
4901- * evaluates to a Map or Document).
4836+ * Creates an expression that evaluates to the provided pipeline.
49024837 *
4903- * @param expression The expression evaluating to a map/document.
4904- * @param key The key of the field to access.
4905- * @return An {@link Expression} representing the value of the field.
4838+ * @param pipeline The pipeline to use as an expression.
4839+ * @return A new {@link Expression} representing the pipeline value.
49064840 */
4907- @ BetaApi
4908- public static Expression getField ( Expression expression , String key ) {
4909- return new FunctionExpression ( "field" , ImmutableList . of ( expression , constant ( key )) );
4841+ @ InternalApi
4842+ public static Expression pipeline ( Pipeline pipeline ) {
4843+ return new PipelineValueExpression ( pipeline );
49104844 }
49114845
49124846 /**
49134847 * Internal expression representing a variable reference.
49144848 *
4915- * <p>
4916- * This evaluates to the value of a variable defined in a pipeline context.
4849+ * <p>This evaluates to the value of a variable defined in a pipeline context.
49174850 */
49184851 static class Variable extends Expression {
49194852 private final String name ;
@@ -4928,9 +4861,7 @@ public Value toProto() {
49284861 }
49294862 }
49304863
4931- /**
4932- * Internal expression representing a pipeline value.
4933- */
4864+ /** Internal expression representing a pipeline value. */
49344865 static class PipelineValueExpression extends Expression {
49354866 private final Pipeline pipeline ;
49364867
@@ -4943,5 +4874,4 @@ public Value toProto() {
49434874 return pipeline .toProtoValue ();
49444875 }
49454876 }
4946-
49474877}
0 commit comments