Skip to content

Commit b4f04ac

Browse files
committed
Fix add and multiply
1 parent 8bbbfaa commit b4f04ac

File tree

1 file changed

+33
-49
lines changed
  • firebase-firestore/src/main/java/com/google/firebase/firestore/pipeline

1 file changed

+33
-49
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/pipeline/expressions.kt

Lines changed: 33 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -747,52 +747,48 @@ abstract class Expr internal constructor() {
747747
@JvmStatic fun sqrt(numericField: String): Expr = FunctionExpr("sqrt", numericField)
748748

749749
/**
750-
* Creates an expression that adds numeric expressions and constants.
750+
* Creates an expression that adds numeric expressions.
751751
*
752752
* @param first Numeric expression to add.
753753
* @param second Numeric expression to add.
754-
* @param others Additional numeric expressions or constants to add.
755754
* @return A new [Expr] representing the addition operation.
756755
*/
757756
@JvmStatic
758-
fun add(first: Expr, second: Expr, vararg others: Any): Expr =
759-
FunctionExpr("add", first, second, *others)
757+
fun add(first: Expr, second: Expr): Expr =
758+
FunctionExpr("add", first, second)
760759

761760
/**
762-
* Creates an expression that adds numeric expressions and constants.
761+
* Creates an expression that adds numeric expressions with a constant.
763762
*
764763
* @param first Numeric expression to add.
765764
* @param second Constant to add.
766-
* @param others Additional numeric expressions or constants to add.
767765
* @return A new [Expr] representing the addition operation.
768766
*/
769767
@JvmStatic
770-
fun add(first: Expr, second: Number, vararg others: Any): Expr =
771-
FunctionExpr("add", first, second, *others)
768+
fun add(first: Expr, second: Number): Expr =
769+
FunctionExpr("add", first, second)
772770

773771
/**
774-
* Creates an expression that adds a numeric field with numeric expressions and constants.
772+
* Creates an expression that adds a numeric field with a numeric expression.
775773
*
776774
* @param numericFieldName Numeric field to add.
777775
* @param second Numeric expression to add to field value.
778-
* @param others Additional numeric expressions or constants to add.
779776
* @return A new [Expr] representing the addition operation.
780777
*/
781778
@JvmStatic
782-
fun add(numericFieldName: String, second: Expr, vararg others: Any): Expr =
783-
FunctionExpr("add", numericFieldName, second, *others)
779+
fun add(numericFieldName: String, second: Expr): Expr =
780+
FunctionExpr("add", numericFieldName, second)
784781

785782
/**
786-
* Creates an expression that adds a numeric field with numeric expressions and constants.
783+
* Creates an expression that adds a numeric field with constant.
787784
*
788785
* @param numericFieldName Numeric field to add.
789786
* @param second Constant to add.
790-
* @param others Additional numeric expressions or constants to add.
791787
* @return A new [Expr] representing the addition operation.
792788
*/
793789
@JvmStatic
794-
fun add(numericFieldName: String, second: Number, vararg others: Any): Expr =
795-
FunctionExpr("add", numericFieldName, second, *others)
790+
fun add(numericFieldName: String, second: Number): Expr =
791+
FunctionExpr("add", numericFieldName, second)
796792

797793
/**
798794
* Creates an expression that subtracts two expressions.
@@ -839,52 +835,48 @@ abstract class Expr internal constructor() {
839835
FunctionExpr("subtract", numericFieldName, subtrahend)
840836

841837
/**
842-
* Creates an expression that multiplies numeric expressions and constants.
838+
* Creates an expression that multiplies numeric expressions.
843839
*
844840
* @param first Numeric expression to multiply.
845841
* @param second Numeric expression to multiply.
846-
* @param others Additional numeric expressions or constants to multiply.
847842
* @return A new [Expr] representing the multiplication operation.
848843
*/
849844
@JvmStatic
850-
fun multiply(first: Expr, second: Expr, vararg others: Any): Expr =
851-
FunctionExpr("multiply", first, second, *others)
845+
fun multiply(first: Expr, second: Expr): Expr =
846+
FunctionExpr("multiply", first, second)
852847

853848
/**
854-
* Creates an expression that multiplies numeric expressions and constants.
849+
* Creates an expression that multiplies numeric expressions with a constant.
855850
*
856851
* @param first Numeric expression to multiply.
857852
* @param second Constant to multiply.
858-
* @param others Additional numeric expressions or constants to multiply.
859853
* @return A new [Expr] representing the multiplication operation.
860854
*/
861855
@JvmStatic
862-
fun multiply(first: Expr, second: Number, vararg others: Any): Expr =
863-
FunctionExpr("multiply", first, second, *others)
856+
fun multiply(first: Expr, second: Number): Expr =
857+
FunctionExpr("multiply", first, second)
864858

865859
/**
866-
* Creates an expression that multiplies a numeric field with numeric expressions and constants.
860+
* Creates an expression that multiplies a numeric field with a numeric expression.
867861
*
868862
* @param numericFieldName Numeric field to multiply.
869-
* @param second Numeric expression to add to field multiply.
870-
* @param others Additional numeric expressions or constants to multiply.
863+
* @param second Numeric expression to multiply.
871864
* @return A new [Expr] representing the multiplication operation.
872865
*/
873866
@JvmStatic
874-
fun multiply(numericFieldName: String, second: Expr, vararg others: Any): Expr =
875-
FunctionExpr("multiply", numericFieldName, second, *others)
867+
fun multiply(numericFieldName: String, second: Expr): Expr =
868+
FunctionExpr("multiply", numericFieldName, second)
876869

877870
/**
878-
* Creates an expression that multiplies a numeric field with numeric expressions and constants.
871+
* Creates an expression that multiplies a numeric field with a constant.
879872
*
880873
* @param numericFieldName Numeric field to multiply.
881874
* @param second Constant to multiply.
882-
* @param others Additional numeric expressions or constants to multiply.
883875
* @return A new [Expr] representing the multiplication operation.
884876
*/
885877
@JvmStatic
886-
fun multiply(numericFieldName: String, second: Number, vararg others: Any): Expr =
887-
FunctionExpr("multiply", numericFieldName, second, *others)
878+
fun multiply(numericFieldName: String, second: Number): Expr =
879+
FunctionExpr("multiply", numericFieldName, second)
888880

889881
/**
890882
* Creates an expression that divides two numeric expressions.
@@ -2990,24 +2982,20 @@ abstract class Expr internal constructor() {
29902982
fun documentId(): Expr = Companion.documentId(this)
29912983

29922984
/**
2993-
* Creates an expression that adds this numeric expression to other numeric expressions and
2994-
* constants.
2985+
* Creates an expression that adds this numeric expression to another numeric expression.
29952986
*
29962987
* @param second Numeric expression to add.
2997-
* @param others Additional numeric expressions or constants to add.
29982988
* @return A new [Expr] representing the addition operation.
29992989
*/
3000-
fun add(second: Expr, vararg others: Any): Expr = Companion.add(this, second, *others)
2990+
fun add(second: Expr): Expr = Companion.add(this, second)
30012991

30022992
/**
3003-
* Creates an expression that adds this numeric expression to other numeric expressions and
3004-
* constants.
2993+
* Creates an expression that adds this numeric expression to a constants.
30052994
*
30062995
* @param second Constant to add.
3007-
* @param others Additional numeric expressions or constants to add.
30082996
* @return A new [Expr] representing the addition operation.
30092997
*/
3010-
fun add(second: Number, vararg others: Any): Expr = Companion.add(this, second, *others)
2998+
fun add(second: Number): Expr = Companion.add(this, second)
30112999

30123000
/**
30133001
* Creates an expression that subtracts a constant from this numeric expression.
@@ -3026,24 +3014,20 @@ abstract class Expr internal constructor() {
30263014
fun subtract(subtrahend: Number): Expr = Companion.subtract(this, subtrahend)
30273015

30283016
/**
3029-
* Creates an expression that multiplies this numeric expression to other numeric expressions and
3030-
* constants.
3017+
* Creates an expression that multiplies this numeric expression with another numeric expression.
30313018
*
30323019
* @param second Numeric expression to multiply.
3033-
* @param others Additional numeric expressions or constants to multiply.
30343020
* @return A new [Expr] representing the multiplication operation.
30353021
*/
3036-
fun multiply(second: Expr, vararg others: Any): Expr = Companion.multiply(this, second, *others)
3022+
fun multiply(second: Expr): Expr = Companion.multiply(this, second)
30373023

30383024
/**
3039-
* Creates an expression that multiplies this numeric expression to other numeric expressions and
3040-
* constants.
3025+
* Creates an expression that multiplies this numeric expression with a constant.
30413026
*
30423027
* @param second Constant to multiply.
3043-
* @param others Additional numeric expressions or constants to multiply.
30443028
* @return A new [Expr] representing the multiplication operation.
30453029
*/
3046-
fun multiply(second: Number, vararg others: Any): Expr = Companion.multiply(this, second, *others)
3030+
fun multiply(second: Number): Expr = Companion.multiply(this, second)
30473031

30483032
/**
30493033
* Creates an expression that divides this numeric expression by another numeric expression.

0 commit comments

Comments
 (0)