-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add iterateAll method to Page, update example and snippet #333
Conversation
7468113
to
22c655e
Compare
@@ -35,6 +37,50 @@ | |||
Page<T> nextPage(); | |||
} | |||
|
|||
static class PageIterator<T> implements java.util.Iterator<T> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
22c655e
to
7a72399
Compare
Fixed in place. |
Page<T> nextPage = currentPage.nextPage(); | ||
if (nextPage != null) { | ||
currentPage = nextPage; | ||
currentPageIterator = currentPage.values().iterator(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Sorry to insist but I am just trying to understand.
According to which criteria? Is this documented somewhere?
So in your example what does prevent the next page request to give up again at the same point returning an empty result list? I am being picky because I don't want to add a loop if I am not sure according to which criteria it terminates. |
No problem. The questions are great!
Yes, you are right. I also verified that with @BrandonY a while back.
Nothing stop also the next result to be empty, this is why it is in a loop.
The only true indication that there are "no-more-results" is a |
This confused me, indeed. Thanks for the clarifications! |
Add iterateAll method to Page, update example and snippet
…s to v2.1.0 (#333) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-workflows](https://togithub.com/googleapis/java-workflows) | `2.0.2` -> `2.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-workflows/2.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-workflows/2.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-workflows/2.1.0/compatibility-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-workflows/2.1.0/confidence-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-workflows</summary> ### [`v2.1.0`](https://togithub.com/googleapis/java-workflows/blob/master/CHANGELOG.md#​210-httpswwwgithubcomgoogleapisjava-workflowscomparev202v210-2021-09-01) [Compare Source](https://togithub.com/googleapis/java-workflows/compare/v2.0.2...v2.1.0) ##### Features - Remove use of deprecated gradle command in java README ([#​1196](https://www.togithub.com/googleapis/java-workflows/issues/1196)) ([#​327](https://www.togithub.com/googleapis/java-workflows/issues/327)) ([5525ccd](https://www.github.com/googleapis/java-workflows/commit/5525ccd9eb08a07be773aaee773812a6c42ec483)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#​329](https://www.togithub.com/googleapis/java-workflows/issues/329)) ([c8cf2d8](https://www.github.com/googleapis/java-workflows/commit/c8cf2d848689b49beb398d9be088d7da1d1c1107)) ##### [2.0.2](https://www.github.com/googleapis/java-workflows/compare/v2.0.1...v2.0.2) (2021-08-23) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#​321](https://www.togithub.com/googleapis/java-workflows/issues/321)) ([332dfd5](https://www.github.com/googleapis/java-workflows/commit/332dfd508eaac6f6ca2d2f5b463df3c80ae9e435)) ##### [2.0.1](https://www.github.com/googleapis/java-workflows/compare/v2.0.0...v2.0.1) (2021-08-12) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#​315](https://www.togithub.com/googleapis/java-workflows/issues/315)) ([a187352](https://www.github.com/googleapis/java-workflows/commit/a1873529849dd569be91758e5f70fa94233a9c21)) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-workflows).
…-info-reports-plugin to v3.4.0 (#333) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-project-info-reports-plugin](https://maven.apache.org/plugins/) ([source](https://togithub.com/apache/maven-project-info-reports-plugin)) | `3.3.0` -> `3.4.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/compatibility-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/confidence-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-workflow-executions). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMTcuNCIsInVwZGF0ZWRJblZlciI6IjMyLjExNy40In0=-->
…to v3.7.0 (#333) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-channel](https://togithub.com/googleapis/java-) | `3.6.1` -> `3.7.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-channel/3.7.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-channel/3.7.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-channel/3.7.0/compatibility-slim/3.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-channel/3.7.0/confidence-slim/3.6.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-channel). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMzUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEzNS4xIn0=-->
…center-insights to v2.3.6 (#333) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-contact-center-insights](https://togithub.com/googleapis/java-contact-center-insights) | `2.3.3` -> `2.3.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-contact-center-insights/2.3.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-contact-center-insights/2.3.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-contact-center-insights/2.3.6/compatibility-slim/2.3.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-contact-center-insights/2.3.6/confidence-slim/2.3.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-contact-center-insights</summary> ### [`v2.3.6`](https://togithub.com/googleapis/java-contact-center-insights/blob/HEAD/CHANGELOG.md#​236-httpsgithubcomgoogleapisjava-contact-center-insightscomparev235v236-2022-07-11) [Compare Source](https://togithub.com/googleapis/java-contact-center-insights/compare/v2.3.5...v2.3.6) ##### Bug Fixes - update gapic-generator-java with mock service generation fixes ([#​306](https://togithub.com/googleapis/java-contact-center-insights/issues/306)) ([45c0a15](https://togithub.com/googleapis/java-contact-center-insights/commit/45c0a15b1b1657d67fdf7bb2e808e47d99f43b6f)) ### [`v2.3.5`](https://togithub.com/googleapis/java-contact-center-insights/blob/HEAD/CHANGELOG.md#​235-httpsgithubcomgoogleapisjava-contact-center-insightscomparev234v235-2022-07-01) [Compare Source](https://togithub.com/googleapis/java-contact-center-insights/compare/v2.3.4...v2.3.5) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.13.8 ([#​311](https://togithub.com/googleapis/java-contact-center-insights/issues/311)) ([6912a2b](https://togithub.com/googleapis/java-contact-center-insights/commit/6912a2b135e249c12d66c2b6da9f5617d57d1a3d)) - update dependency com.google.cloud:google-cloud-pubsub to v1.120.0 ([#​315](https://togithub.com/googleapis/java-contact-center-insights/issues/315)) ([853b7a7](https://togithub.com/googleapis/java-contact-center-insights/commit/853b7a7e5d83afea0682ae987d092c234a1d1201)) ### [`v2.3.4`](https://togithub.com/googleapis/java-contact-center-insights/blob/HEAD/CHANGELOG.md#​234-httpsgithubcomgoogleapisjava-contact-center-insightscomparev233v234-2022-06-30) [Compare Source](https://togithub.com/googleapis/java-contact-center-insights/compare/v2.3.3...v2.3.4) ##### Documentation - Updating comments ([13f7937](https://togithub.com/googleapis/java-contact-center-insights/commit/13f79379f3cf01e4525fcbe2f6834354751b57fa)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.13.3 ([#​303](https://togithub.com/googleapis/java-contact-center-insights/issues/303)) ([192f667](https://togithub.com/googleapis/java-contact-center-insights/commit/192f667b695b64e457611eefc2005676c099e7d4)) - update dependency com.google.cloud:google-cloud-bigquery to v2.13.4 ([#​304](https://togithub.com/googleapis/java-contact-center-insights/issues/304)) ([62a8663](https://togithub.com/googleapis/java-contact-center-insights/commit/62a86636da8f642054f88124604eff11b46c0ef7)) - update dependency com.google.cloud:google-cloud-bigquery to v2.13.5 ([#​307](https://togithub.com/googleapis/java-contact-center-insights/issues/307)) ([3fad9d0](https://togithub.com/googleapis/java-contact-center-insights/commit/3fad9d0e780c32d55e348a8c2faa9f36289553b7)) - update dependency com.google.cloud:google-cloud-bigquery to v2.13.6 ([#​308](https://togithub.com/googleapis/java-contact-center-insights/issues/308)) ([da0694b](https://togithub.com/googleapis/java-contact-center-insights/commit/da0694b7b948fafa3a09a563e20ec52f0c7d71ef)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#​305](https://togithub.com/googleapis/java-contact-center-insights/issues/305)) ([8e7c000](https://togithub.com/googleapis/java-contact-center-insights/commit/8e7c0008512a82ab26a6dce8ed795483a710a4cf)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-contact-center-insights). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMzUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEzNS4xIn0=-->
…s#1687) (googleapis#333) * chore(java): add a note in README for migrated split repos Disable renovate bot and flaky bot for split repositories that have moved to the Java monorepo. The Java monorepo will pass the "monorepo=True" parameter to java.common_templates method in its owlbot.py files so that the migration note will not appear in the README in the monorepo. Co-authored-by: Jeff Ching <[email protected]> Source-Link: googleapis/synthtool@d4b2916 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:edae91ccdd2dded2f572ec341a768ad180305a3e8fbfd93064b28e237d35920a Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Jeff Ching <[email protected]>
🤖 I have created a release *beep* *boop* --- ### [1.3.2](googleapis/java-iam@v1.3.1...v1.3.2) (2022-04-15) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#332](googleapis/java-iam#332)) ([21e926c](googleapis/java-iam@21e926c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This PR fixes #330.
iterateAll
method toPage
interface and implements the iterator inPageImpl
.