@@ -255,29 +255,29 @@ public Entity read(Key key) {
255255 * <p>The Datastore may return a partial result set, so an execution of this method may
256256 * result in several Datastore queries.
257257 *
258- * <p>The limit included in the {@link StructuredQuery}, will be a maximum count of entities
258+ * <p>The limit included in the {@link StructuredQuery}, will be a maximum count of objects
259259 * in the returned iterator.
260260 *
261261 * <p>The returned {@link DsQueryIterator} allows to {@linkplain DsQueryIterator#nextPageQuery()
262- * create a query} to the next page of entities reusing an existing cursor.
262+ * create a query} to the next page of results reusing an existing cursor.
263263 *
264264 * <p>The resulting {@code Iterator} is evaluated lazily. A call to
265265 * {@link Iterator#remove() Iterator.remove()} causes an {@link UnsupportedOperationException}.
266266 *
267267 * @param query
268268 * {@link Query} to execute upon the Datastore
269- * @param <E >
269+ * @param <R >
270270 * the type of queried objects
271271 * @return results fo the query as a lazily evaluated {@link Iterator}
272272 * @see DatastoreReader#run(Query)
273273 */
274- public <E > DsQueryIterator <E > read (StructuredQuery <E > query ) {
274+ public <R > DsQueryIterator <R > read (StructuredQuery <R > query ) {
275275 Namespace namespace = currentNamespace ();
276- StructuredQuery <E > queryWithNamespace =
276+ StructuredQuery <R > queryWithNamespace =
277277 query .toBuilder ()
278278 .setNamespace (namespace .getValue ())
279279 .build ();
280- DsQueryIterator <E > result = new DsQueryIterator <>(queryWithNamespace , actor );
280+ DsQueryIterator <R > result = new DsQueryIterator <>(queryWithNamespace , actor );
281281 return result ;
282282 }
283283
@@ -294,13 +294,13 @@ public <E> DsQueryIterator<E> read(StructuredQuery<E> query) {
294294 * {@link Query} to execute upon the Datastore
295295 * @param pageSize
296296 * a non-zero number of elements to be returned per a single read from Datastore
297- * @param <E >
297+ * @param <R >
298298 * the type of queried objects
299299 * @return results fo the query as a lazily evaluated {@link Iterator}
300300 * @throws IllegalArgumentException
301301 * if the provided {@linkplain StructuredQuery#getLimit() query includes a limit}
302302 */
303- <E > Iterator <E > readAll (StructuredQuery <E > query , int pageSize ) {
303+ <R > Iterator <R > readAll (StructuredQuery <R > query , int pageSize ) {
304304 return readAllPageByPage (query , pageSize );
305305 }
306306
@@ -315,13 +315,13 @@ <E> Iterator<E> readAll(StructuredQuery<E> query, int pageSize) {
315315 *
316316 * @param query
317317 * {@link Query} to execute upon the Datastore
318- * @param <E >
318+ * @param <R >
319319 * the type of queried objects
320320 * @return results fo the query as a lazily evaluated {@link Iterator}
321321 * @throws IllegalArgumentException
322322 * if the provided {@linkplain StructuredQuery#getLimit() query includes a limit}
323323 */
324- <E > Iterator <E > readAll (StructuredQuery <E > query ) {
324+ <R > Iterator <R > readAll (StructuredQuery <R > query ) {
325325 return readAllPageByPage (query , null );
326326 }
327327
@@ -339,28 +339,28 @@ <E> Iterator<E> readAll(StructuredQuery<E> query) {
339339 * @param pageSize
340340 * a non-zero number of elements to be returned per a single read from Datastore;
341341 * if {@code null} the page size will be dictated by the Datastore
342- * @param <E >
342+ * @param <R >
343343 * the type of queried objects
344344 * @return results fo the query as a lazily evaluated {@link Iterator}
345345 * @throws IllegalArgumentException
346346 * if the provided {@linkplain StructuredQuery#getLimit() query includes a limit} or
347347 * the provided {@code batchSize} is 0
348348 */
349349 @ SuppressWarnings ("unchecked" ) // Checked logically.
350- private <E > Iterator <E >
351- readAllPageByPage (StructuredQuery <E > query , @ Nullable Integer pageSize ) {
350+ private <R > Iterator <R >
351+ readAllPageByPage (StructuredQuery <R > query , @ Nullable Integer pageSize ) {
352352 checkArgument (query .getLimit () == null ,
353353 "Cannot limit a number of entities for \" read all\" operation." );
354354 checkArgument (pageSize == null || pageSize != 0 ,
355355 "The size of a single read operation cannot be 0." );
356356
357- StructuredQuery <E > limitedQuery = limit (query , pageSize );
357+ StructuredQuery <R > limitedQuery = limit (query , pageSize );
358358 return stream (new DsQueryPageIterator <>(limitedQuery , this ))
359359 .flatMap (Streams ::stream )
360360 .iterator ();
361361 }
362362
363- private static <E > StructuredQuery <E > limit (StructuredQuery <E > query ,
363+ private static <R > StructuredQuery <R > limit (StructuredQuery <R > query ,
364364 @ Nullable Integer batchSize ) {
365365 return batchSize == null
366366 ? query
0 commit comments