Skip to content

Commit 6842a83

Browse files
committed
Fix docStubs task
1 parent c7605b6 commit 6842a83

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/CollectionReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ public Task<DocumentReference> add(@NonNull Object data) {
131131

132132
@NonNull
133133
public Pipeline pipeline() {
134-
return new Pipeline(firestore, new CollectionSource(getPath()));
134+
return new Pipeline(firestore, firestore.getUserDataReader(), new CollectionSource(getPath()));
135135
}
136136
}

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,7 @@ DatabaseId getDatabaseId() {
857857
}
858858

859859
@NonNull
860-
@RestrictTo(RestrictTo.Scope.LIBRARY)
861-
public UserDataReader getUserDataReader() {
860+
UserDataReader getUserDataReader() {
862861
return userDataReader;
863862
}
864863

firebase-firestore/src/main/java/com/google/firebase/firestore/Pipeline.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,17 @@ import com.google.firestore.v1.Value
4949
class Pipeline
5050
internal constructor(
5151
internal val firestore: FirebaseFirestore,
52+
internal val userDataReader: UserDataReader,
5253
private val stages: FluentIterable<Stage>
5354
) {
5455
internal constructor(
5556
firestore: FirebaseFirestore,
57+
userDataReader: UserDataReader,
5658
stage: Stage
57-
) : this(firestore, FluentIterable.of(stage))
59+
) : this(firestore, userDataReader, FluentIterable.of(stage))
5860

5961
private fun append(stage: Stage): Pipeline {
60-
return Pipeline(firestore, stages.append(stage))
62+
return Pipeline(firestore, userDataReader, stages.append(stage))
6163
}
6264

6365
fun execute(): Task<PipelineSnapshot> {
@@ -86,7 +88,7 @@ internal constructor(
8688

8789
internal fun toPipelineProto(): com.google.firestore.v1.Pipeline =
8890
com.google.firestore.v1.Pipeline.newBuilder()
89-
.addAllStages(stages.map { it.toProtoStage(firestore.userDataReader) })
91+
.addAllStages(stages.map { it.toProtoStage(userDataReader) })
9092
.build()
9193

9294
fun genericStage(name: String, vararg params: Any) =
@@ -167,18 +169,18 @@ class PipelineSource internal constructor(private val firestore: FirebaseFiresto
167169
"Provided collection reference is from a different Firestore instance."
168170
)
169171
}
170-
return Pipeline(firestore, CollectionSource(ref.path))
172+
return Pipeline(firestore, firestore.userDataReader, CollectionSource(ref.path))
171173
}
172174

173175
fun collectionGroup(collectionId: String): Pipeline {
174176
Preconditions.checkNotNull(collectionId, "Provided collection ID must not be null.")
175177
require(!collectionId.contains("/")) {
176178
"Invalid collectionId '$collectionId'. Collection IDs must not contain '/'."
177179
}
178-
return Pipeline(firestore, CollectionGroupSource(collectionId))
180+
return Pipeline(firestore, firestore.userDataReader, CollectionGroupSource(collectionId))
179181
}
180182

181-
fun database(): Pipeline = Pipeline(firestore, DatabaseSource())
183+
fun database(): Pipeline = Pipeline(firestore, firestore.userDataReader, DatabaseSource())
182184

183185
fun documents(vararg documents: String): Pipeline {
184186
// Validate document path by converting to DocumentReference
@@ -196,6 +198,7 @@ class PipelineSource internal constructor(private val firestore: FirebaseFiresto
196198
}
197199
return Pipeline(
198200
firestore,
201+
firestore.userDataReader,
199202
DocumentsSource(documents.map { docRef -> "/" + docRef.path }.toTypedArray())
200203
)
201204
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ protected constructor(private val name: String, private val params: Array<out Ex
363363
private constructor(name: String, param: Expr, vararg params: Any) : this(name, arrayOf(param, *toArrayOfExprOrConstant(params)))
364364
private constructor(name: String, fieldName: String, vararg params: Any) : this(name, arrayOf(Field.of(fieldName), *toArrayOfExprOrConstant(params)))
365365
companion object {
366+
367+
@JvmStatic fun generic(name: String, vararg expr: Expr) = Function(name, expr)
368+
366369
@JvmStatic
367370
fun and(condition: BooleanExpr, vararg conditions: BooleanExpr) = BooleanExpr("and", condition, *conditions)
368371

@@ -787,6 +790,12 @@ class BooleanExpr internal constructor(name: String, params: Array<out Expr>) :
787790
internal constructor(name: String, param: Expr, vararg params: Any) : this(name, arrayOf(param, *toArrayOfExprOrConstant(params)))
788791
internal constructor(name: String, fieldName: String, vararg params: Any) : this(name, arrayOf(Field.of(fieldName), *toArrayOfExprOrConstant(params)))
789792

793+
companion object {
794+
795+
@JvmStatic fun generic(name: String, vararg expr: Expr) = BooleanExpr(name, expr)
796+
797+
}
798+
790799
fun not() = not(this)
791800

792801
fun countIf(): AggregateExpr = AggregateExpr.countIf(this)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal constructor(private val name: String, private val options: Map<String,
3131
builder.putAllOptions(options)
3232
return builder.build()
3333
}
34-
protected abstract fun args(userDataReader: UserDataReader): Sequence<Value>
34+
internal abstract fun args(userDataReader: UserDataReader): Sequence<Value>
3535
}
3636

3737
class GenericStage internal constructor(name: String, private val params: List<GenericArg>) :

0 commit comments

Comments
 (0)