diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 4782add50..4e86fe0bb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,13 +10,16 @@ assignees: '' Thanks for stopping by to let us know something could be better! --- -**PLEASE READ** +**PLEASE READ** -If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/). This will ensure a timely response. +If you have a support contract with Google, please create an issue in +the [support console](https://cloud.google.com/support/). This will ensure a timely response. -Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform [support resources page](https://developers.google.com/maps/support/). +Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, +and expert support at the Google Maps Platform [support resources page](https://developers.google.com/maps/support/). -If your bug or feature request is not related to this particular library, please visit the Google Maps Platform [issue trackers](https://developers.google.com/maps/support/#issue_tracker). +If your bug or feature request is not related to this particular library, please visit the Google Maps +Platform [issue trackers](https://developers.google.com/maps/support/#issue_tracker). Check for answers on StackOverflow with the [google-maps](http://stackoverflow.com/questions/tagged/google-maps) tag. @@ -32,7 +35,7 @@ Please be sure to include as much information as possible: #### Steps to reproduce - 1. ? +1. ? #### Code example @@ -41,6 +44,7 @@ Please be sure to include as much information as possible: ``` #### Stack trace + ``` # example ``` diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 39c3c5abe..91a139d49 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -10,26 +10,29 @@ assignees: '' Thanks for stopping by to let us know something could be better! --- -**PLEASE READ** +**PLEASE READ** -If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/). This will ensure a timely response. +If you have a support contract with Google, please create an issue in +the [support console](https://cloud.google.com/support/). This will ensure a timely response. -Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform [support resources page](https://developers.google.com/maps/support/). +Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, +and expert support at the Google Maps Platform [support resources page](https://developers.google.com/maps/support/). -If your bug or feature request is not related to this particular library, please visit the Google Maps Platform [issue trackers](https://developers.google.com/maps/support/#issue_tracker). +If your bug or feature request is not related to this particular library, please visit the Google Maps +Platform [issue trackers](https://developers.google.com/maps/support/#issue_tracker). Check for answers on StackOverflow with the [google-maps](http://stackoverflow.com/questions/tagged/google-maps) tag. --- - **Is your feature request related to a problem? Please describe.** +**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - **Describe the solution you'd like** +**Describe the solution you'd like** A clear and concise description of what you want to happen. - **Describe alternatives you've considered** +**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. - **Additional context** +**Additional context** Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md index 495a5c99b..41eb1f036 100644 --- a/.github/ISSUE_TEMPLATE/support_request.md +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -8,13 +8,16 @@ assignees: '' --- -**PLEASE READ** +**PLEASE READ** -If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/). This will ensure a timely response. +If you have a support contract with Google, please create an issue in +the [support console](https://cloud.google.com/support/). This will ensure a timely response. -Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform [support resources page](https://developers.google.com/maps/support/). +Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, +and expert support at the Google Maps Platform [support resources page](https://developers.google.com/maps/support/). -If your bug or feature request is not related to this particular library, please visit the Google Maps Platform [issue trackers](https://developers.google.com/maps/support/#issue_tracker). +If your bug or feature request is not related to this particular library, please visit the Google Maps +Platform [issue trackers](https://developers.google.com/maps/support/#issue_tracker). Check for answers on StackOverflow with the [google-maps](http://stackoverflow.com/questions/tagged/google-maps) tag. diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index 4d7d59e9b..51bf0c7a6 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -3,8 +3,12 @@ name: Pull request about: Create a pull request label: 'triage me' --- -Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea + +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes +smoothly: + +- [ ] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the + change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8fd289403..3dba0109a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,9 @@ version: 2 updates: -- package-ecosystem: gradle - directory: "." - schedule: - interval: "weekly" - open-pull-requests-limit: 10 - commit-message: - prefix: chore(deps) + - package-ecosystem: gradle + directory: "." + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + commit-message: + prefix: chore(deps) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 009707d4c..ac0602fe5 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,7 +3,9 @@ Thank you for opening a Pull Request! --- Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea + +- [ ] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the + change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) diff --git a/.github/stale.yml b/.github/stale.yml index 8ed0e080f..925cfd703 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -8,7 +8,7 @@ daysUntilStale: 120 daysUntilClose: 180 # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) -onlyLabels: [] +onlyLabels: [ ] # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index a7b2d39c0..65a41ea62 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -19,26 +19,26 @@ squashMergeAllowed: true mergeCommitAllowed: false deleteBranchOnMerge: true branchProtectionRules: -- pattern: main - isAdminEnforced: false - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - 'cla/google' - - 'test' - - 'snippet-bot check' - - 'header-check' - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true -- pattern: master - isAdminEnforced: false - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - 'cla/google' - - 'test' - - 'snippet-bot check' - - 'header-check' - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true + - pattern: main + isAdminEnforced: false + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - 'cla/google' + - 'test' + - 'snippet-bot check' + - 'header-check' + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + - pattern: master + isAdminEnforced: false + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - 'cla/google' + - 'test' + - 'snippet-bot check' + - 'header-check' + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true permissionRules: - team: admin permission: admin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc900a36a..79cac3398 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,38 +22,38 @@ jobs: release: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - with: - token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} - - name: Create .gpg key - run: | - echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc - gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc - - SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g') - sed -i -e "s,sonatypeUsername=,sonatypeUsername=$SONATYPE_USERNAME,g" gradle.properties - sed -i -e "s,sonatypePassword=,sonatypePassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties - sed -i -e "s,githubPassword=,githubPassword=$GITHUB_PASSWORD,g" gradle.properties - sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties - sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties - sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties - env: - GPG_KEY_ARMOR: "${{ secrets.SYNCED_GPG_KEY_ARMOR }}" - GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }} - GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }} - SONATYPE_PASSWORD: '${{ secrets.SYNCED_SONATYPE_PASSWORD }}' - SONATYPE_USERNAME: ${{ secrets.SYNCED_SONATYPE_USERNAME }} - GITHUB_PASSWORD: '${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}' - - name: Semantic Release - uses: cycjimmy/semantic-release-action@v3 - with: - extra_plugins: | - "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" - "@google/semantic-release-replace-plugin" - "@semantic-release/exec" - "@semantic-release/git" - "@semantic-release/github" - env: - GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} + - name: Checkout + uses: actions/checkout@v2 + with: + token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} + - name: Create .gpg key + run: | + echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc + gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc + + SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g') + sed -i -e "s,sonatypeUsername=,sonatypeUsername=$SONATYPE_USERNAME,g" gradle.properties + sed -i -e "s,sonatypePassword=,sonatypePassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties + sed -i -e "s,githubPassword=,githubPassword=$GITHUB_PASSWORD,g" gradle.properties + sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties + sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties + sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties + env: + GPG_KEY_ARMOR: "${{ secrets.SYNCED_GPG_KEY_ARMOR }}" + GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }} + GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }} + SONATYPE_PASSWORD: '${{ secrets.SYNCED_SONATYPE_PASSWORD }}' + SONATYPE_USERNAME: ${{ secrets.SYNCED_SONATYPE_USERNAME }} + GITHUB_PASSWORD: '${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}' + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v3 + with: + extra_plugins: | + "@semantic-release/commit-analyzer" + "@semantic-release/release-notes-generator" + "@google/semantic-release-replace-plugin" + "@semantic-release/exec" + "@semantic-release/git" + "@semantic-release/github" + env: + GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b112f7ed..728342668 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,22 +17,22 @@ name: Test on: repository_dispatch: - types: [test] + types: [ test ] pull_request: - branches: ['*'] + branches: [ '*' ] push: - branches: ['*'] + branches: [ '*' ] jobs: test: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 - - name: Run tests - run: ./gradlew check test jacocoTestReport --stacktrace + - name: Run tests + run: ./gradlew check test jacocoTestReport --stacktrace - - name: Send test results to CodeCov - run: bash <(curl -s https://codecov.io/bash) + - name: Send test results to CodeCov + run: bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md index b630f4fc4..ac4146cc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,88 +8,126 @@ All notable changes to this project will be documented in this file. ### Bug Fixes -- increase stale bot window ([22a2b4c](https://github.com/googlemaps/google-maps-services-java/commit/22a2b4cb8d6530e59494b9b25681bbae33d5ee60)) -- added path exception when there is no center or no zoom (#650) ([47acc92](https://github.com/googlemaps/google-maps-services-java/commit/47acc92)), closes [#650](https://github.com/googlemaps/google-maps-services-java/issues/650) -- added primary school as a poi AddressType to silence SafeEnumAdapter … (#646) ([6500947](https://github.com/googlemaps/google-maps-services-java/commit/6500947)), closes [#646](https://github.com/googlemaps/google-maps-services-java/issues/646) -- typo in FieldMask lon to lng ([#654](https://github.com/googlemaps/google-maps-services-java/issues/654)) ([244d188](https://github.com/googlemaps/google-maps-services-java/commit/244d188a229fdbde29bc397228a2cc1ca28946d6)) +- increase stale bot + window ([22a2b4c](https://github.com/googlemaps/google-maps-services-java/commit/22a2b4cb8d6530e59494b9b25681bbae33d5ee60)) +- added path exception when there is no center or no zoom ( + #650) ([47acc92](https://github.com/googlemaps/google-maps-services-java/commit/47acc92)), + closes [#650](https://github.com/googlemaps/google-maps-services-java/issues/650) +- added primary school as a poi AddressType to silence SafeEnumAdapter … ( + #646) ([6500947](https://github.com/googlemaps/google-maps-services-java/commit/6500947)), + closes [#646](https://github.com/googlemaps/google-maps-services-java/issues/646) +- typo in FieldMask lon to + lng ([#654](https://github.com/googlemaps/google-maps-services-java/issues/654)) ([244d188](https://github.com/googlemaps/google-maps-services-java/commit/244d188a229fdbde29bc397228a2cc1ca28946d6)) ### Features -- add support for experience id. ([#647](https://github.com/googlemaps/google-maps-services-java/issues/647)) ([b229806](https://github.com/googlemaps/google-maps-services-java/commit/b229806526c9a1e0b98a71889a209446a1035d36)) +- add support for experience + id. ([#647](https://github.com/googlemaps/google-maps-services-java/issues/647)) ([b229806](https://github.com/googlemaps/google-maps-services-java/commit/b229806526c9a1e0b98a71889a209446a1035d36)) ## [v0.10.2](https://github.com/googlemaps/google-maps-services-java/compare/v0.10.1...v0.10.2) - 2019-12-10 ### Merged -- fix: Add MAX_ROUTE_LENGTH_EXCEEDED Exception [`#632`](https://github.com/googlemaps/google-maps-services-java/pull/632) +- fix: Add MAX_ROUTE_LENGTH_EXCEEDED + Exception [`#632`](https://github.com/googlemaps/google-maps-services-java/pull/632) - fix: Add more AddressComponentTypes [`#633`](https://github.com/googlemaps/google-maps-services-java/pull/633) -- automate publish to staging repository with additional nexus plugins [`#610`](https://github.com/googlemaps/google-maps-services-java/pull/610) -- mark additional deprecations for alt_id and scope in PlaceDetails [`#613`](https://github.com/googlemaps/google-maps-services-java/pull/613) +- automate publish to staging repository with additional nexus + plugins [`#610`](https://github.com/googlemaps/google-maps-services-java/pull/610) +- mark additional deprecations for alt_id and scope in + PlaceDetails [`#613`](https://github.com/googlemaps/google-maps-services-java/pull/613) - update okhttp dependency [`#614`](https://github.com/googlemaps/google-maps-services-java/pull/614) -- direct users to https://www.javadoc.io/doc/com.google.maps/google-maps-services [`#612`](https://github.com/googlemaps/google-maps-services-java/pull/612) -- add additional place types and deprecate non supported [`#608`](https://github.com/googlemaps/google-maps-services-java/pull/608) -- deprecation warning for place fields: `alt_id`, `id`, `reference`, and `scope` [`#605`](https://github.com/googlemaps/google-maps-services-java/pull/605) +- direct users + to https://www.javadoc.io/doc/com.google.maps/google-maps-services [`#612`](https://github.com/googlemaps/google-maps-services-java/pull/612) +- add additional place types and deprecate non + supported [`#608`](https://github.com/googlemaps/google-maps-services-java/pull/608) +- deprecation warning for place fields: `alt_id`, `id`, `reference`, + and `scope` [`#605`](https://github.com/googlemaps/google-maps-services-java/pull/605) ### Commits -- add stale config [`f7b2116`](https://github.com/googlemaps/google-maps-services-java/commit/f7b211626318b6e5ee079a5e211b66720fd3f639) -- update issue templates [`e6273e3`](https://github.com/googlemaps/google-maps-services-java/commit/e6273e39ee33bb4e84fb3c055c170ebed443d298) -- modify stale config [`fd856b8`](https://github.com/googlemaps/google-maps-services-java/commit/fd856b89de01bd0d64b194a2f1c2ad5333b1d778) +- add stale + config [`f7b2116`](https://github.com/googlemaps/google-maps-services-java/commit/f7b211626318b6e5ee079a5e211b66720fd3f639) +- update issue + templates [`e6273e3`](https://github.com/googlemaps/google-maps-services-java/commit/e6273e39ee33bb4e84fb3c055c170ebed443d298) +- modify stale + config [`fd856b8`](https://github.com/googlemaps/google-maps-services-java/commit/fd856b89de01bd0d64b194a2f1c2ad5333b1d778) ## [v0.10.1](https://github.com/googlemaps/google-maps-services-java/compare/v0.10.0...v0.10.1) - 2019-09-23 ### Merged -- Fixes issue where deps were not being added to pom.xml [`#606`](https://github.com/googlemaps/google-maps-services-java/pull/606) +- Fixes issue where deps were not being added to + pom.xml [`#606`](https://github.com/googlemaps/google-maps-services-java/pull/606) - Add tourist_attraction address type [`#601`](https://github.com/googlemaps/google-maps-services-java/pull/601) - add changelog [`#598`](https://github.com/googlemaps/google-maps-services-java/pull/598) -- add subfields to mask values for place details request [`#597`](https://github.com/googlemaps/google-maps-services-java/pull/597) +- add subfields to mask values for place details + request [`#597`](https://github.com/googlemaps/google-maps-services-java/pull/597) - add github issue templates [`#595`](https://github.com/googlemaps/google-maps-services-java/pull/595) -- Include plus_code in PlaceDetailsRequest.FieldMask [`#594`](https://github.com/googlemaps/google-maps-services-java/pull/594) +- Include plus_code in + PlaceDetailsRequest.FieldMask [`#594`](https://github.com/googlemaps/google-maps-services-java/pull/594) ### Commits -- update changelog for 0.10.1 [`943c0d9`](https://github.com/googlemaps/google-maps-services-java/commit/943c0d972301bb5bbf0980cd0951665eec6a5b30) -- add contributor and stackoverflow badges [`47b5c1c`](https://github.com/googlemaps/google-maps-services-java/commit/47b5c1cfca0ed093a81a3c11e97a6d19adb32892) +- update changelog for + 0.10.1 [`943c0d9`](https://github.com/googlemaps/google-maps-services-java/commit/943c0d972301bb5bbf0980cd0951665eec6a5b30) +- add contributor and stackoverflow + badges [`47b5c1c`](https://github.com/googlemaps/google-maps-services-java/commit/47b5c1cfca0ed093a81a3c11e97a6d19adb32892) ## [v0.10.0](https://github.com/googlemaps/google-maps-services-java/compare/v0.9.4...v0.10.0) - 2019-08-27 ### Merged -- Updates to build/release and v0.10.0 version rev [`#592`](https://github.com/googlemaps/google-maps-services-java/pull/592) +- Updates to build/release and v0.10.0 version + rev [`#592`](https://github.com/googlemaps/google-maps-services-java/pull/592) - Making serializable PlusCode [`#591`](https://github.com/googlemaps/google-maps-services-java/pull/591) -- Upgrades build process to use maven-publish plugin [`#590`](https://github.com/googlemaps/google-maps-services-java/pull/590) -- add userRatingsTotal to PlaceDetails, add unit tests [`#587`](https://github.com/googlemaps/google-maps-services-java/pull/587) -- Add an overloaded method to enable query and location parameters [`#588`](https://github.com/googlemaps/google-maps-services-java/pull/588) +- Upgrades build process to use maven-publish + plugin [`#590`](https://github.com/googlemaps/google-maps-services-java/pull/590) +- add userRatingsTotal to PlaceDetails, add unit + tests [`#587`](https://github.com/googlemaps/google-maps-services-java/pull/587) +- Add an overloaded method to enable query and location + parameters [`#588`](https://github.com/googlemaps/google-maps-services-java/pull/588) ### Commits -- Update JavaDoc [`ec0f0a8`](https://github.com/googlemaps/google-maps-services-java/commit/ec0f0a827f6e61b464c67e54d1a2c752ec05141d) -- Opening up v0.9.5 for development [`68993f0`](https://github.com/googlemaps/google-maps-services-java/commit/68993f053bc9324e3a4dc597eeedaf0a3bfcef7d) +- Update + JavaDoc [`ec0f0a8`](https://github.com/googlemaps/google-maps-services-java/commit/ec0f0a827f6e61b464c67e54d1a2c752ec05141d) +- Opening up v0.9.5 for + development [`68993f0`](https://github.com/googlemaps/google-maps-services-java/commit/68993f053bc9324e3a4dc597eeedaf0a3bfcef7d) ## [v0.9.4](https://github.com/googlemaps/google-maps-services-java/compare/v0.9.3...v0.9.4) - 2019-08-07 ### Merged - Releasing v0.9.4 [`#586`](https://github.com/googlemaps/google-maps-services-java/pull/586) -- Gradle downgrade 5.5.1 -> 5.0 for broken signing [`#585`](https://github.com/googlemaps/google-maps-services-java/pull/585) +- Gradle downgrade 5.5.1 -> 5.0 for broken + signing [`#585`](https://github.com/googlemaps/google-maps-services-java/pull/585) - Versions version update [`#584`](https://github.com/googlemaps/google-maps-services-java/pull/584) - Version update [`#582`](https://github.com/googlemaps/google-maps-services-java/pull/582) -- #572: updated the access modifier for response inner classes in Api Classes [`#581`](https://github.com/googlemaps/google-maps-services-java/pull/581) -- Fix: Format java files that break tests using gradlew check [`#573`](https://github.com/googlemaps/google-maps-services-java/pull/573) -- Add user_ratings_total to the PlaceSearchResult [`#571`](https://github.com/googlemaps/google-maps-services-java/pull/571) -- Add Serializable definition to AutoCompletePrediction$Term class [`#569`](https://github.com/googlemaps/google-maps-services-java/pull/569) -- [NOT URGENT] add new textSearchQuery (overload) method with test [`#567`](https://github.com/googlemaps/google-maps-services-java/pull/567) -- Validate TextSearchRequest without query if type is set [`#566`](https://github.com/googlemaps/google-maps-services-java/pull/566) -- Add implementation of Serializable to AutocompletePrediction [`#565`](https://github.com/googlemaps/google-maps-services-java/pull/565) +- #572: updated the access modifier for response inner classes in Api + Classes [`#581`](https://github.com/googlemaps/google-maps-services-java/pull/581) +- Fix: Format java files that break tests using gradlew + check [`#573`](https://github.com/googlemaps/google-maps-services-java/pull/573) +- Add user_ratings_total to the + PlaceSearchResult [`#571`](https://github.com/googlemaps/google-maps-services-java/pull/571) +- Add Serializable definition to AutoCompletePrediction$Term + class [`#569`](https://github.com/googlemaps/google-maps-services-java/pull/569) +- [NOT URGENT] add new textSearchQuery (overload) method with + test [`#567`](https://github.com/googlemaps/google-maps-services-java/pull/567) +- Validate TextSearchRequest without query if type is + set [`#566`](https://github.com/googlemaps/google-maps-services-java/pull/566) +- Add implementation of Serializable to + AutocompletePrediction [`#565`](https://github.com/googlemaps/google-maps-services-java/pull/565) - Add Light Rail Station into PlaceType [`#562`](https://github.com/googlemaps/google-maps-services-java/pull/562) - Add meal_delivery AddressComponentType [`#561`](https://github.com/googlemaps/google-maps-services-java/pull/561) ### Commits -- add new textSearchQuery method with test [`96a6a56`](https://github.com/googlemaps/google-maps-services-java/commit/96a6a561cbae878404fac4c4b6e3413134632c34) -- Add user_ratings_total response field to PlaceSearchResult class [`a8762d8`](https://github.com/googlemaps/google-maps-services-java/commit/a8762d8474fd516a08f84444a4a6ff5e19c2c1d3) -- OKHttp3 v4.0.1 -> v3.14.2 due to warnings [`d8f69b8`](https://github.com/googlemaps/google-maps-services-java/commit/d8f69b89c91dc498fabfaf259085dfae30d92437) +- add new textSearchQuery method with + test [`96a6a56`](https://github.com/googlemaps/google-maps-services-java/commit/96a6a561cbae878404fac4c4b6e3413134632c34) +- Add user_ratings_total response field to PlaceSearchResult + class [`a8762d8`](https://github.com/googlemaps/google-maps-services-java/commit/a8762d8474fd516a08f84444a4a6ff5e19c2c1d3) +- OKHttp3 v4.0.1 -> v3.14.2 due to + warnings [`d8f69b8`](https://github.com/googlemaps/google-maps-services-java/commit/d8f69b89c91dc498fabfaf259085dfae30d92437) ## [v0.9.3](https://github.com/googlemaps/google-maps-services-java/compare/v0.9.2...v0.9.3) - 2019-03-20 @@ -100,9 +138,12 @@ All notable changes to this project will be documented in this file. ### Commits -- Releasing version 0.9.3 [`bc26e75`](https://github.com/googlemaps/google-maps-services-java/commit/bc26e75c6232ca3d69f17c2a09e1543d9a23e538) -- Opening up v0.9.3 for development [`027b37d`](https://github.com/googlemaps/google-maps-services-java/commit/027b37d3fcbec30ea8995cf3f5f6704eb9bbb6e9) -- Linking to v0.9.2 javadoc [`c5bc2e7`](https://github.com/googlemaps/google-maps-services-java/commit/c5bc2e74aa49addd8ca47bfe5756b728da656df9) +- Releasing version + 0.9.3 [`bc26e75`](https://github.com/googlemaps/google-maps-services-java/commit/bc26e75c6232ca3d69f17c2a09e1543d9a23e538) +- Opening up v0.9.3 for + development [`027b37d`](https://github.com/googlemaps/google-maps-services-java/commit/027b37d3fcbec30ea8995cf3f5f6704eb9bbb6e9) +- Linking to v0.9.2 + javadoc [`c5bc2e7`](https://github.com/googlemaps/google-maps-services-java/commit/c5bc2e74aa49addd8ca47bfe5756b728da656df9) ## [v0.9.2](https://github.com/googlemaps/google-maps-services-java/compare/v0.9.1...v0.9.2) - 2019-02-28 @@ -111,32 +152,40 @@ All notable changes to this project will be documented in this file. - Reverting Gradle version. [`#550`](https://github.com/googlemaps/google-maps-services-java/pull/550) - ./gradlew depUp [`#549`](https://github.com/googlemaps/google-maps-services-java/pull/549) - Fixing Google Java Style [`#543`](https://github.com/googlemaps/google-maps-services-java/pull/543) -- adding a default no-arg constructor to EncodedPolyline [`#542`](https://github.com/googlemaps/google-maps-services-java/pull/542) +- adding a default no-arg constructor to + EncodedPolyline [`#542`](https://github.com/googlemaps/google-maps-services-java/pull/542) - TextSearch: add region parameter [`#538`](https://github.com/googlemaps/google-maps-services-java/pull/538) - Upgrade to commons-lang3 [`#537`](https://github.com/googlemaps/google-maps-services-java/pull/537) - ./gradlew depUp [`#536`](https://github.com/googlemaps/google-maps-services-java/pull/536) - ./gradlew googleJavaFormat [`#530`](https://github.com/googlemaps/google-maps-services-java/pull/530) - Added support to Place IDs [`#526`](https://github.com/googlemaps/google-maps-services-java/pull/526) - ./gradlew dependencyUpdates [`#529`](https://github.com/googlemaps/google-maps-services-java/pull/529) -- Looks like case of DateTimeFormat is locale dependant. [`#528`](https://github.com/googlemaps/google-maps-services-java/pull/528) +- Looks like case of DateTimeFormat is locale + dependant. [`#528`](https://github.com/googlemaps/google-maps-services-java/pull/528) - Formatting and making the tests pass [`#527`](https://github.com/googlemaps/google-maps-services-java/pull/527) -- Adds a method for setting the departure time as "now" [`#525`](https://github.com/googlemaps/google-maps-services-java/pull/525) +- Adds a method for setting the departure time as " + now" [`#525`](https://github.com/googlemaps/google-maps-services-java/pull/525) - Fix a small formatting mistake in the docs. [`#523`](https://github.com/googlemaps/google-maps-services-java/pull/523) - Update README.md [`#522`](https://github.com/googlemaps/google-maps-services-java/pull/522) ### Commits -- Clean up [`6097ff3`](https://github.com/googlemaps/google-maps-services-java/commit/6097ff3f08c9676f84157269a24e208c5d72c89d) -- Added a method to make waypoints from Place IDs [`d2d05a7`](https://github.com/googlemaps/google-maps-services-java/commit/d2d05a7cf124bec97e09a6cd0004d08f95004b25) -- updating google java format to 0.8-SNAPSHOT [`de357b7`](https://github.com/googlemaps/google-maps-services-java/commit/de357b77feaa536b287cfbe8a14b13d87825910d) +- Clean + up [`6097ff3`](https://github.com/googlemaps/google-maps-services-java/commit/6097ff3f08c9676f84157269a24e208c5d72c89d) +- Added a method to make waypoints from Place + IDs [`d2d05a7`](https://github.com/googlemaps/google-maps-services-java/commit/d2d05a7cf124bec97e09a6cd0004d08f95004b25) +- updating google java format to + 0.8-SNAPSHOT [`de357b7`](https://github.com/googlemaps/google-maps-services-java/commit/de357b77feaa536b287cfbe8a14b13d87825910d) ## [v0.9.1](https://github.com/googlemaps/google-maps-services-java/compare/v0.9.0...v0.9.1) - 2018-11-28 ### Merged -- Force Jacoco version 0.8.2 for OpenJDK 11 compatibility [`#517`](https://github.com/googlemaps/google-maps-services-java/pull/517) +- Force Jacoco version 0.8.2 for OpenJDK 11 + compatibility [`#517`](https://github.com/googlemaps/google-maps-services-java/pull/517) - Fix Google Error Prone warnings [`#513`](https://github.com/googlemaps/google-maps-services-java/pull/513) -- DirectionsLeg, TransitDetails: use ZonedDateTime instead of LocalDateTime [`#516`](https://github.com/googlemaps/google-maps-services-java/pull/516) +- DirectionsLeg, TransitDetails: use ZonedDateTime instead of + LocalDateTime [`#516`](https://github.com/googlemaps/google-maps-services-java/pull/516) - Versions update [`#515`](https://github.com/googlemaps/google-maps-services-java/pull/515) - Add StaticMapsRequest.path(EncodedPolyline) [`#511`](https://github.com/googlemaps/google-maps-services-java/pull/511) - Added Maps Static API in README.md [`#507`](https://github.com/googlemaps/google-maps-services-java/pull/507) @@ -144,39 +193,52 @@ All notable changes to this project will be documented in this file. ### Commits -- Add missing @Override annotations [`7c7a72c`](https://github.com/googlemaps/google-maps-services-java/commit/7c7a72c8f70e2967346eed971d9fd7bda237f1d4) -- Avoid implicit use of default charset [`88204f6`](https://github.com/googlemaps/google-maps-services-java/commit/88204f6406c355b6da2596b63efcf7bbd472391d) -- Updates and making tests pass [`c9f89bc`](https://github.com/googlemaps/google-maps-services-java/commit/c9f89bc525923b334f8a5a6eac428e7dce0775fc) +- Add missing @Override + annotations [`7c7a72c`](https://github.com/googlemaps/google-maps-services-java/commit/7c7a72c8f70e2967346eed971d9fd7bda237f1d4) +- Avoid implicit use of default + charset [`88204f6`](https://github.com/googlemaps/google-maps-services-java/commit/88204f6406c355b6da2596b63efcf7bbd472391d) +- Updates and making tests + pass [`c9f89bc`](https://github.com/googlemaps/google-maps-services-java/commit/c9f89bc525923b334f8a5a6eac428e7dce0775fc) ## [v0.9.0](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.11...v0.9.0) - 2018-09-24 ### Merged - Version 0.9 [`#503`](https://github.com/googlemaps/google-maps-services-java/pull/503) -- Java 1.8 is now the minimum supported version [`#502`](https://github.com/googlemaps/google-maps-services-java/pull/502) +- Java 1.8 is now the minimum supported + version [`#502`](https://github.com/googlemaps/google-maps-services-java/pull/502) - Dependencies update, reformat, and fixup [`#501`](https://github.com/googlemaps/google-maps-services-java/pull/501) - Migrate to java.time [`#421`](https://github.com/googlemaps/google-maps-services-java/pull/421) - SessionToken is now serializable [`#495`](https://github.com/googlemaps/google-maps-services-java/pull/495) ### Commits -- Java 1.8 is the new minimum [`ab013ba`](https://github.com/googlemaps/google-maps-services-java/commit/ab013bac3a4871329f77ca67a37a6d2ce3d2c0e6) -- Tidyup [`839fbd1`](https://github.com/googlemaps/google-maps-services-java/commit/839fbd1c8cfdac75ded5dca678f7ab452d4d5e9a) -- Opening up v0.2.12 development [`5809326`](https://github.com/googlemaps/google-maps-services-java/commit/5809326ee8da2dc60dce9a3116eea71cd59516cd) +- Java 1.8 is the new + minimum [`ab013ba`](https://github.com/googlemaps/google-maps-services-java/commit/ab013bac3a4871329f77ca67a37a6d2ce3d2c0e6) +- + +Tidyup [`839fbd1`](https://github.com/googlemaps/google-maps-services-java/commit/839fbd1c8cfdac75ded5dca678f7ab452d4d5e9a) + +- Opening up v0.2.12 + development [`5809326`](https://github.com/googlemaps/google-maps-services-java/commit/5809326ee8da2dc60dce9a3116eea71cd59516cd) ## [v0.2.11](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.10...v0.2.11) - 2018-08-31 ### Merged - Updated dependencies [`#494`](https://github.com/googlemaps/google-maps-services-java/pull/494) -- Enabling setting SessionToken for placeDetails [`#493`](https://github.com/googlemaps/google-maps-services-java/pull/493) +- Enabling setting SessionToken for + placeDetails [`#493`](https://github.com/googlemaps/google-maps-services-java/pull/493) - Opening up v0.2.11 for development [`#490`](https://github.com/googlemaps/google-maps-services-java/pull/490) ### Commits -- Release v0.2.11 [`a22237e`](https://github.com/googlemaps/google-maps-services-java/commit/a22237e9fb0c39d3b8e9e7f4c308788a4c8d776c) -- Update README.md [`4fb6af0`](https://github.com/googlemaps/google-maps-services-java/commit/4fb6af021a2019688ed057f1e87adafd36799354) -- Updating link to v0.2.10 Javadoc [`6894d11`](https://github.com/googlemaps/google-maps-services-java/commit/6894d11c2d9f8cb7c19d51b2b5b4925ac395bc2e) +- Release + v0.2.11 [`a22237e`](https://github.com/googlemaps/google-maps-services-java/commit/a22237e9fb0c39d3b8e9e7f4c308788a4c8d776c) +- Update + README.md [`4fb6af0`](https://github.com/googlemaps/google-maps-services-java/commit/4fb6af021a2019688ed057f1e87adafd36799354) +- Updating link to v0.2.10 + Javadoc [`6894d11`](https://github.com/googlemaps/google-maps-services-java/commit/6894d11c2d9f8cb7c19d51b2b5b4925ac395bc2e) ## [v0.2.10](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.9...v0.2.10) - 2018-08-15 @@ -186,7 +248,8 @@ All notable changes to this project will be documented in this file. - Updating dependencies [`#486`](https://github.com/googlemaps/google-maps-services-java/pull/486) - Cleaning up [`#485`](https://github.com/googlemaps/google-maps-services-java/pull/485) - ./gradlew googleJavaFormat [`#484`](https://github.com/googlemaps/google-maps-services-java/pull/484) -- Replace "baseUrlForTesting()" with usage-neutral "baseUrlOverride()" [`#471`](https://github.com/googlemaps/google-maps-services-java/pull/471) +- Replace "baseUrlForTesting()" with usage-neutral " + baseUrlOverride()" [`#471`](https://github.com/googlemaps/google-maps-services-java/pull/471) - Tidying up [`#483`](https://github.com/googlemaps/google-maps-services-java/pull/483) - Fix for #478 [`#482`](https://github.com/googlemaps/google-maps-services-java/pull/482) - PlaceDetails: add adr_address support [`#480`](https://github.com/googlemaps/google-maps-services-java/pull/480) @@ -194,43 +257,62 @@ All notable changes to this project will be documented in this file. - Remove Radar Search support [`#469`](https://github.com/googlemaps/google-maps-services-java/pull/469) - ./gradlew googleJavaFormat [`#476`](https://github.com/googlemaps/google-maps-services-java/pull/476) - Add non-stopover waypoint support [`#468`](https://github.com/googlemaps/google-maps-services-java/pull/468) -- Change *RequestHandler Builder signatures to do chainable calls [`#470`](https://github.com/googlemaps/google-maps-services-java/pull/470) -- Supply -html4 to javadoc with JDK 10 and later [`#472`](https://github.com/googlemaps/google-maps-services-java/pull/472) +- Change *RequestHandler Builder signatures to do chainable + calls [`#470`](https://github.com/googlemaps/google-maps-services-java/pull/470) +- Supply -html4 to javadoc with JDK 10 and + later [`#472`](https://github.com/googlemaps/google-maps-services-java/pull/472) - Update gradle dependency keywords [`#474`](https://github.com/googlemaps/google-maps-services-java/pull/474) - Fix an NPE in DirectionsStep.toString() [`#475`](https://github.com/googlemaps/google-maps-services-java/pull/475) -- Opening up v0.2.10 for development [`#466`](https://github.com/googlemaps/google-maps-services-java/pull/466) +- Opening up v0.2.10 for development [`#466`](https://github.com/googlemaps/google-maps-services-java/pull/466) ### Commits -- Remove support for Radar Search, which is now past EOL as of June 30, 2018 [`e814a89`](https://github.com/googlemaps/google-maps-services-java/commit/e814a89befde30059c1b7b058ba3bc7ff2771b1f) -- Add non-stopover Waypoint support. [`e42752f`](https://github.com/googlemaps/google-maps-services-java/commit/e42752f7af776ae33b74640975535d7abce52850) -- Add regression test for DirectionsResult.toString() [`7c60f67`](https://github.com/googlemaps/google-maps-services-java/commit/7c60f67445f8465575945525e89dc124a0743119) +- Remove support for Radar Search, which is now past EOL as of June 30, + 2018 [`e814a89`](https://github.com/googlemaps/google-maps-services-java/commit/e814a89befde30059c1b7b058ba3bc7ff2771b1f) +- Add non-stopover Waypoint + support. [`e42752f`](https://github.com/googlemaps/google-maps-services-java/commit/e42752f7af776ae33b74640975535d7abce52850) +- Add regression test for + DirectionsResult.toString() [`7c60f67`](https://github.com/googlemaps/google-maps-services-java/commit/7c60f67445f8465575945525e89dc124a0743119) ## [v0.2.9](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.8...v0.2.9) - 2018-07-06 ### Merged - Releasing v0.2.9 [`#465`](https://github.com/googlemaps/google-maps-services-java/pull/465) -- Add okHttpClientBuilder() for customizing the OkHttpClient [`#464`](https://github.com/googlemaps/google-maps-services-java/pull/464) -- Add "continent" AddressType and AddressComponentType [`#463`](https://github.com/googlemaps/google-maps-services-java/pull/463) -- Add value-based toString()s for model objects [`#452`](https://github.com/googlemaps/google-maps-services-java/pull/452) -- Add Plus Code support to GeocodingResult and PlaceDetails [`#459`](https://github.com/googlemaps/google-maps-services-java/pull/459) +- Add okHttpClientBuilder() for customizing the + OkHttpClient [`#464`](https://github.com/googlemaps/google-maps-services-java/pull/464) +- Add "continent" AddressType and + AddressComponentType [`#463`](https://github.com/googlemaps/google-maps-services-java/pull/463) +- Add value-based toString()s for model + objects [`#452`](https://github.com/googlemaps/google-maps-services-java/pull/452) +- Add Plus Code support to GeocodingResult and + PlaceDetails [`#459`](https://github.com/googlemaps/google-maps-services-java/pull/459) - Tidying up tests [`#461`](https://github.com/googlemaps/google-maps-services-java/pull/461) - Reverting SLF4J version bump. [`#460`](https://github.com/googlemaps/google-maps-services-java/pull/460) - Add note on GeoApiContext reuse in Javadoc [`#456`](https://github.com/googlemaps/google-maps-services-java/pull/456) -- Have OkHttpRequestHandler evict connectionPool on shutdown [`#455`](https://github.com/googlemaps/google-maps-services-java/pull/455) -- Deprecate NearbySearchRequest.type(PlaceType...) [`#454`](https://github.com/googlemaps/google-maps-services-java/pull/454) -- PlaceDetails: make types an AddressType[] instead of String[] [`#453`](https://github.com/googlemaps/google-maps-services-java/pull/453) -- Adjust link in README so Markdown inspectors do not complain [`#451`](https://github.com/googlemaps/google-maps-services-java/pull/451) -- Improve EnumsTest unit test for AddressType and AddressComponentType [`#444`](https://github.com/googlemaps/google-maps-services-java/pull/444) -- Bringing dependencies up to date. [`#449`](https://github.com/googlemaps/google-maps-services-java/pull/449) +- Have OkHttpRequestHandler evict connectionPool on + shutdown [`#455`](https://github.com/googlemaps/google-maps-services-java/pull/455) +- Deprecate NearbySearchRequest.type( + PlaceType...) [`#454`](https://github.com/googlemaps/google-maps-services-java/pull/454) +- PlaceDetails: make types an AddressType[] instead of + String[] [`#453`](https://github.com/googlemaps/google-maps-services-java/pull/453) +- Adjust link in README so Markdown inspectors do not + complain [`#451`](https://github.com/googlemaps/google-maps-services-java/pull/451) +- Improve EnumsTest unit test for AddressType and + AddressComponentType [`#444`](https://github.com/googlemaps/google-maps-services-java/pull/444) +- Bringing dependencies up to date. [`#449`](https://github.com/googlemaps/google-maps-services-java/pull/449) - ./gradlew googleJavaFormat [`#448`](https://github.com/googlemaps/google-maps-services-java/pull/448) -- Replace bogus @url Javadoc tag with HTML link [`#447`](https://github.com/googlemaps/google-maps-services-java/pull/447) +- Replace bogus @url Javadoc tag with HTML + link [`#447`](https://github.com/googlemaps/google-maps-services-java/pull/447) - Minor code hygiene suggestions [`#446`](https://github.com/googlemaps/google-maps-services-java/pull/446) -- Add Javadoc for DirectionsApiRequest static methods [`#443`](https://github.com/googlemaps/google-maps-services-java/pull/443) -- LocalTestServerContext: use "expected[s]" as assertion parameter name [`#445`](https://github.com/googlemaps/google-maps-services-java/pull/445) -- Add more AddressTypes and AddressComponentTypes [`#437`](https://github.com/googlemaps/google-maps-services-java/pull/437) -- New AddressComponentTypes: general_contractor, food, store, etc... [`#436`](https://github.com/googlemaps/google-maps-services-java/pull/436) +- Add Javadoc for DirectionsApiRequest static + methods [`#443`](https://github.com/googlemaps/google-maps-services-java/pull/443) +- LocalTestServerContext: use "expected[s]" as assertion parameter + name [`#445`](https://github.com/googlemaps/google-maps-services-java/pull/445) +- Add more AddressTypes and + AddressComponentTypes [`#437`](https://github.com/googlemaps/google-maps-services-java/pull/437) +- New AddressComponentTypes: general_contractor, food, store, + etc... [`#436`](https://github.com/googlemaps/google-maps-services-java/pull/436) - Add missing fields to PlaceDetails.Review. [`#432`](https://github.com/googlemaps/google-maps-services-java/pull/432) ### Fixed @@ -239,24 +321,32 @@ All notable changes to this project will be documented in this file. ### Commits -- Merge upstream master [`eb72951`](https://github.com/googlemaps/google-maps-services-java/commit/eb72951102dc178ede794048459f17834219e71e) -- EnumsTest: improve source code and results readability [`9cb1014`](https://github.com/googlemaps/google-maps-services-java/commit/9cb1014c0b706a60a6f94458176774a189fb53c0) -- EnumsTest: add missing entries for AddressType [`d32d598`](https://github.com/googlemaps/google-maps-services-java/commit/d32d598146cec3034e59966febb40f3dad0d6da9) +- Merge upstream + master [`eb72951`](https://github.com/googlemaps/google-maps-services-java/commit/eb72951102dc178ede794048459f17834219e71e) +- EnumsTest: improve source code and results + readability [`9cb1014`](https://github.com/googlemaps/google-maps-services-java/commit/9cb1014c0b706a60a6f94458176774a189fb53c0) +- EnumsTest: add missing entries for + AddressType [`d32d598`](https://github.com/googlemaps/google-maps-services-java/commit/d32d598146cec3034e59966febb40f3dad0d6da9) ## [v0.2.8](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.7...v0.2.8) - 2018-06-25 ### Merged -- Find place from text, and place details field masks. [`#424`](https://github.com/googlemaps/google-maps-services-java/pull/424) +- Find place from text, and place details field + masks. [`#424`](https://github.com/googlemaps/google-maps-services-java/pull/424) - Add new types to AddressType enum. [`#428`](https://github.com/googlemaps/google-maps-services-java/pull/428) - ./gradlew googleJavaFormat [`#423`](https://github.com/googlemaps/google-maps-services-java/pull/423) -- Add support for scale parameter on custom icons to be able to use hi-DPI icons when map scale > 1 [`#419`](https://github.com/googlemaps/google-maps-services-java/pull/419) +- Add support for scale parameter on custom icons to be able to use hi-DPI icons when map scale > + 1 [`#419`](https://github.com/googlemaps/google-maps-services-java/pull/419) ### Commits -- Find place by text, and place details field masks. [`acf74b4`](https://github.com/googlemaps/google-maps-services-java/commit/acf74b404ed81dd993dff1ef5b80be1673d86519) -- Adding LocationBias parameter [`bca82fe`](https://github.com/googlemaps/google-maps-services-java/commit/bca82fe5a8eb544fef629b680df6df1d526c1af8) -- Field masks differ between place details and find place from text. [`3620c27`](https://github.com/googlemaps/google-maps-services-java/commit/3620c27f7c5b9a829106c585abda79c652632aa2) +- Find place by text, and place details field + masks. [`acf74b4`](https://github.com/googlemaps/google-maps-services-java/commit/acf74b404ed81dd993dff1ef5b80be1673d86519) +- Adding LocationBias + parameter [`bca82fe`](https://github.com/googlemaps/google-maps-services-java/commit/bca82fe5a8eb544fef629b680df6df1d526c1af8) +- Field masks differ between place details and find place from + text. [`3620c27`](https://github.com/googlemaps/google-maps-services-java/commit/3620c27f7c5b9a829106c585abda79c652632aa2) ## [v0.2.7](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.6...v0.2.7) - 2018-04-10 @@ -273,9 +363,12 @@ All notable changes to this project will be documented in this file. ### Commits -- Filling in StaticMapRequest, along with an additional AddressType [`2486d00`](https://github.com/googlemaps/google-maps-services-java/commit/2486d003a18a183595d3c6ceb2e509c53a4899d4) -- Initial Static Maps implementation [`593b194`](https://github.com/googlemaps/google-maps-services-java/commit/593b1943151441fa070339e94527eb6e4d3c667c) -- Adding tests [`98ad5b3`](https://github.com/googlemaps/google-maps-services-java/commit/98ad5b3003a0b8bf9dfd966903a8015cfa266974) +- Filling in StaticMapRequest, along with an additional + AddressType [`2486d00`](https://github.com/googlemaps/google-maps-services-java/commit/2486d003a18a183595d3c6ceb2e509c53a4899d4) +- Initial Static Maps + implementation [`593b194`](https://github.com/googlemaps/google-maps-services-java/commit/593b1943151441fa070339e94527eb6e4d3c667c) +- Adding + tests [`98ad5b3`](https://github.com/googlemaps/google-maps-services-java/commit/98ad5b3003a0b8bf9dfd966903a8015cfa266974) ## [v0.2.6](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.5...v0.2.6) - 2018-01-09 @@ -284,44 +377,58 @@ All notable changes to this project will be documented in this file. - Releasing version 0.2.6 [`#402`](https://github.com/googlemaps/google-maps-services-java/pull/402) - Increase default QPS from 10 to 50 [`#401`](https://github.com/googlemaps/google-maps-services-java/pull/401) - Set ComponentFilter's Constructor Public [`#397`](https://github.com/googlemaps/google-maps-services-java/pull/397) -- Revert "Revert "Made the constructor public"" [`#395`](https://github.com/googlemaps/google-maps-services-java/pull/395) +- Revert "Revert "Made the constructor + public"" [`#395`](https://github.com/googlemaps/google-maps-services-java/pull/395) - Revert "Made the constructor public" [`#394`](https://github.com/googlemaps/google-maps-services-java/pull/394) - Made the constructor public [`#393`](https://github.com/googlemaps/google-maps-services-java/pull/393) -- Add java.io.Serializable for inner classes, as it was only added in t… [`#389`](https://github.com/googlemaps/google-maps-services-java/pull/389) +- Add java.io.Serializable for inner classes, as it was only added in + t… [`#389`](https://github.com/googlemaps/google-maps-services-java/pull/389) ### Commits -- Add java.io.Serializable for inner classes, as it was only added in top-level ones. [`887f288`](https://github.com/googlemaps/google-maps-services-java/commit/887f2888b0d0c7e82436e4afcf79f5bcbbc85e5c) -- Made ComponentFilter's Class Constructor Public [`eac7f77`](https://github.com/googlemaps/google-maps-services-java/commit/eac7f77100f3d46d83637bdc7a23720a1fa99b67) -- Made ComponentFilter's Construtor Private [`ca28a78`](https://github.com/googlemaps/google-maps-services-java/commit/ca28a78dd76406bf957a33d5535a9883f7aba900) +- Add java.io.Serializable for inner classes, as it was only added in top-level + ones. [`887f288`](https://github.com/googlemaps/google-maps-services-java/commit/887f2888b0d0c7e82436e4afcf79f5bcbbc85e5c) +- Made ComponentFilter's Class Constructor + Public [`eac7f77`](https://github.com/googlemaps/google-maps-services-java/commit/eac7f77100f3d46d83637bdc7a23720a1fa99b67) +- Made ComponentFilter's Construtor + Private [`ca28a78`](https://github.com/googlemaps/google-maps-services-java/commit/ca28a78dd76406bf957a33d5535a9883f7aba900) ## [v0.2.5](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.4...v0.2.5) - 2017-11-15 ### Merged - Version 0.2.5 release [`#387`](https://github.com/googlemaps/google-maps-services-java/pull/387) -- ./gradlew googleJavaFormat [`#386`](https://github.com/googlemaps/google-maps-services-java/pull/386) +- ./gradlew googleJavaFormat [`#386`](https://github.com/googlemaps/google-maps-services-java/pull/386) - Adding strictbounds to Places Autocomplete [`#385`](https://github.com/googlemaps/google-maps-services-java/pull/385) - AddressType: add night_club [`#384`](https://github.com/googlemaps/google-maps-services-java/pull/384) - AddressType: add travel_agency [`#382`](https://github.com/googlemaps/google-maps-services-java/pull/382) - AddressType: add shoe_store [`#381`](https://github.com/googlemaps/google-maps-services-java/pull/381) -- AddressType: add more types observed by steveetl [`#380`](https://github.com/googlemaps/google-maps-services-java/pull/380) -- added java.io.Serializable to the response model #366 [`#367`](https://github.com/googlemaps/google-maps-services-java/pull/367) +- AddressType: add more types observed by + steveetl [`#380`](https://github.com/googlemaps/google-maps-services-java/pull/380) +- added java.io.Serializable to the response model + #366 [`#367`](https://github.com/googlemaps/google-maps-services-java/pull/367) - AddressType: add beauty care types [`#378`](https://github.com/googlemaps/google-maps-services-java/pull/378) - AddressType: add STADIUM [`#379`](https://github.com/googlemaps/google-maps-services-java/pull/379) - AddressType: add CASINO and PARKING [`#377`](https://github.com/googlemaps/google-maps-services-java/pull/377) - Opening up v0.2.5 development [`#373`](https://github.com/googlemaps/google-maps-services-java/pull/373) - Update Javadoc link for v0.2.4 [`#374`](https://github.com/googlemaps/google-maps-services-java/pull/374) -- Suppress unchecked warning in GeoApiContextTest [`#372`](https://github.com/googlemaps/google-maps-services-java/pull/372) -- Adding required import, and googleJavaFormat [`#370`](https://github.com/googlemaps/google-maps-services-java/pull/370) -- ResponseBody in OkHttpPendingResult was not being closed. [`#368`](https://github.com/googlemaps/google-maps-services-java/pull/368) -- added a shutdown method to GeoApiContext which stops RateLimitExecutorDelayThread #261 [`#365`](https://github.com/googlemaps/google-maps-services-java/pull/365) +- Suppress unchecked warning in + GeoApiContextTest [`#372`](https://github.com/googlemaps/google-maps-services-java/pull/372) +- Adding required import, and + googleJavaFormat [`#370`](https://github.com/googlemaps/google-maps-services-java/pull/370) +- ResponseBody in OkHttpPendingResult was not being + closed. [`#368`](https://github.com/googlemaps/google-maps-services-java/pull/368) +- added a shutdown method to GeoApiContext which stops RateLimitExecutorDelayThread + #261 [`#365`](https://github.com/googlemaps/google-maps-services-java/pull/365) ### Commits -- added java.io.Serializable to the response model [`7bce9dd`](https://github.com/googlemaps/google-maps-services-java/commit/7bce9dd3c129d48e21572f41de157abf407ae171) -- remove comment on serialVersionUID [`8157552`](https://github.com/googlemaps/google-maps-services-java/commit/815755229ba54053f425a335abdb436307b1324f) -- ./gradlew googleJavaFormat [`d36f5ff`](https://github.com/googlemaps/google-maps-services-java/commit/d36f5ff5e94ea33e343848a8bc6fcd1c73cdcbb5) +- added java.io.Serializable to the response + model [`7bce9dd`](https://github.com/googlemaps/google-maps-services-java/commit/7bce9dd3c129d48e21572f41de157abf407ae171) +- remove comment on + serialVersionUID [`8157552`](https://github.com/googlemaps/google-maps-services-java/commit/815755229ba54053f425a335abdb436307b1324f) +- ./gradlew + googleJavaFormat [`d36f5ff`](https://github.com/googlemaps/google-maps-services-java/commit/d36f5ff5e94ea33e343848a8bc6fcd1c73cdcbb5) ## [v0.2.4](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.3...v0.2.4) - 2017-10-06 @@ -331,14 +438,19 @@ All notable changes to this project will be documented in this file. - Tidyup warnings [`#357`](https://github.com/googlemaps/google-maps-services-java/pull/357) - Upgrade Gradle [`#356`](https://github.com/googlemaps/google-maps-services-java/pull/356) - ./gradlew googleJavaFormat [`#354`](https://github.com/googlemaps/google-maps-services-java/pull/354) -- Replace Guava dep with local RateLimiter implementation copy-paste [`#351`](https://github.com/googlemaps/google-maps-services-java/pull/351) -- .gitignore: add /out/ to support IntelliJ IDEA [`#352`](https://github.com/googlemaps/google-maps-services-java/pull/352) +- Replace Guava dep with local RateLimiter implementation + copy-paste [`#351`](https://github.com/googlemaps/google-maps-services-java/pull/351) +- .gitignore: add /out/ to support IntelliJ + IDEA [`#352`](https://github.com/googlemaps/google-maps-services-java/pull/352) ### Commits -- Copy Guava's RateLimiter implementation locally and remove Guava dependency [`9622a59`](https://github.com/googlemaps/google-maps-services-java/commit/9622a59b0c919fa6334d0966952760d16ada532f) -- Opening up v0.2.4 development [`7785c57`](https://github.com/googlemaps/google-maps-services-java/commit/7785c57c1563d14ff6afb555a0efaed8173785ec) -- Updating Javadoc link for v0.2.3 [`8ca6e15`](https://github.com/googlemaps/google-maps-services-java/commit/8ca6e1550537f85f574ce7eaff7dcb635b685939) +- Copy Guava's RateLimiter implementation locally and remove Guava + dependency [`9622a59`](https://github.com/googlemaps/google-maps-services-java/commit/9622a59b0c919fa6334d0966952760d16ada532f) +- Opening up v0.2.4 + development [`7785c57`](https://github.com/googlemaps/google-maps-services-java/commit/7785c57c1563d14ff6afb555a0efaed8173785ec) +- Updating Javadoc link for + v0.2.3 [`8ca6e15`](https://github.com/googlemaps/google-maps-services-java/commit/8ca6e1550537f85f574ce7eaff7dcb635b685939) ## [v0.2.3](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.2...v0.2.3) - 2017-09-13 @@ -347,66 +459,94 @@ All notable changes to this project will be documented in this file. - Releasing version 0.2.3 [`#346`](https://github.com/googlemaps/google-maps-services-java/pull/346) - Cleaning up README.md's markdown [`#345`](https://github.com/googlemaps/google-maps-services-java/pull/345) - ./gradlew googleJavaFormat [`#343`](https://github.com/googlemaps/google-maps-services-java/pull/343) -- adding proxy authentication in GeoApiContext [`#337`](https://github.com/googlemaps/google-maps-services-java/pull/337) +- adding proxy authentication in + GeoApiContext [`#337`](https://github.com/googlemaps/google-maps-services-java/pull/337) - Add note about paging delay [`#339`](https://github.com/googlemaps/google-maps-services-java/pull/339) - Documenting GAE usage [`#335`](https://github.com/googlemaps/google-maps-services-java/pull/335) - Opening up development on v0.2.3 [`#333`](https://github.com/googlemaps/google-maps-services-java/pull/333) ### Commits -- adding proxy authentication in GeoApiContext - googleJavaFormat [`bd5303d`](https://github.com/googlemaps/google-maps-services-java/commit/bd5303d9f8ee1d6694030848bbd45aba77b89e00) -- Documenting new GAE usage [`ddb5363`](https://github.com/googlemaps/google-maps-services-java/commit/ddb536333c515b6d9b909e60e1334587560c5cf6) -- Javadoc for v0.2.2 [`69fd291`](https://github.com/googlemaps/google-maps-services-java/commit/69fd2913acaec29ab8039c97e569777a8828ff6c) +- adding proxy authentication in GeoApiContext - + googleJavaFormat [`bd5303d`](https://github.com/googlemaps/google-maps-services-java/commit/bd5303d9f8ee1d6694030848bbd45aba77b89e00) +- Documenting new GAE + usage [`ddb5363`](https://github.com/googlemaps/google-maps-services-java/commit/ddb536333c515b6d9b909e60e1334587560c5cf6) +- Javadoc for + v0.2.2 [`69fd291`](https://github.com/googlemaps/google-maps-services-java/commit/69fd2913acaec29ab8039c97e569777a8828ff6c) ## [v0.2.2](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.1...v0.2.2) - 2017-08-15 ### Merged - Releasing v0.2.2 [`#332`](https://github.com/googlemaps/google-maps-services-java/pull/332) -- Adding handling for AutocompletePrediction's structured formatting. [`#330`](https://github.com/googlemaps/google-maps-services-java/pull/330) -- guava v22 and v23 reintroduced java 7 support [`#331`](https://github.com/googlemaps/google-maps-services-java/pull/331) +- Adding handling for AutocompletePrediction's structured + formatting. [`#330`](https://github.com/googlemaps/google-maps-services-java/pull/330) +- guava v22 and v23 reintroduced java 7 + support [`#331`](https://github.com/googlemaps/google-maps-services-java/pull/331) - LatLng serialisation constructor. [`#328`](https://github.com/googlemaps/google-maps-services-java/pull/328) - ./gradlew googleJavaFormat [`#327`](https://github.com/googlemaps/google-maps-services-java/pull/327) -- Javadoc: Rephrase to match Google Java Style Guide (classes P) [`#321`](https://github.com/googlemaps/google-maps-services-java/pull/321) -- Javadoc: Rephrase to match Google Java Style Guide (classes G) [`#319`](https://github.com/googlemaps/google-maps-services-java/pull/319) -- Javadoc: Rephrase to match Google Java Style Guide (classes Q-S) [`#322`](https://github.com/googlemaps/google-maps-services-java/pull/322) -- Javadoc: Rephrase to match Google Java Style Guide (classes T) [`#323`](https://github.com/googlemaps/google-maps-services-java/pull/323) -- Javadoc: Rephrase to match Google Java Style Guide (classes U-Z) [`#324`](https://github.com/googlemaps/google-maps-services-java/pull/324) -- Javadoc: Rephrase to match Google Java Style Guide (classes H-O) [`#320`](https://github.com/googlemaps/google-maps-services-java/pull/320) -- Javadoc: Use "latitude/longitude" instead of "latitude,longitude" everywhere [`#325`](https://github.com/googlemaps/google-maps-services-java/pull/325) +- Javadoc: Rephrase to match Google Java Style Guide (classes + P) [`#321`](https://github.com/googlemaps/google-maps-services-java/pull/321) +- Javadoc: Rephrase to match Google Java Style Guide (classes + G) [`#319`](https://github.com/googlemaps/google-maps-services-java/pull/319) +- Javadoc: Rephrase to match Google Java Style Guide (classes + Q-S) [`#322`](https://github.com/googlemaps/google-maps-services-java/pull/322) +- Javadoc: Rephrase to match Google Java Style Guide (classes + T) [`#323`](https://github.com/googlemaps/google-maps-services-java/pull/323) +- Javadoc: Rephrase to match Google Java Style Guide (classes + U-Z) [`#324`](https://github.com/googlemaps/google-maps-services-java/pull/324) +- Javadoc: Rephrase to match Google Java Style Guide (classes + H-O) [`#320`](https://github.com/googlemaps/google-maps-services-java/pull/320) +- Javadoc: Use "latitude/longitude" instead of "latitude,longitude" + everywhere [`#325`](https://github.com/googlemaps/google-maps-services-java/pull/325) - Use Oxford commas in Javadoc [`#317`](https://github.com/googlemaps/google-maps-services-java/pull/317) -- Javadoc: Rephrase to match Google Java Style Guide (classes D-F) [`#318`](https://github.com/googlemaps/google-maps-services-java/pull/318) +- Javadoc: Rephrase to match Google Java Style Guide (classes + D-F) [`#318`](https://github.com/googlemaps/google-maps-services-java/pull/318) - Dropping truncated JavaDoc [`#316`](https://github.com/googlemaps/google-maps-services-java/pull/316) -- Javadoc: Rephrase to match Google Java Style Guide (classes A-C) [`#315`](https://github.com/googlemaps/google-maps-services-java/pull/315) +- Javadoc: Rephrase to match Google Java Style Guide (classes + A-C) [`#315`](https://github.com/googlemaps/google-maps-services-java/pull/315) - Javadoc: Update links and fix typos [`#314`](https://github.com/googlemaps/google-maps-services-java/pull/314) -- README: Point "javadoc" link at the new v0.2.1 javadocs [`#311`](https://github.com/googlemaps/google-maps-services-java/pull/311) +- README: Point "javadoc" link at the new v0.2.1 + javadocs [`#311`](https://github.com/googlemaps/google-maps-services-java/pull/311) - Update build.gradle - Changed guava to v20 [`#308`](https://github.com/googlemaps/google-maps-services-java/pull/308) ### Commits -- Cleaning up Javadoc, and fixing class name typo. (Whups) [`7459bd2`](https://github.com/googlemaps/google-maps-services-java/commit/7459bd26441a60e3943f8e7ae8ddd74241afda5c) -- Use Oxford commas everywhere in Javadoc [`f12ce8a`](https://github.com/googlemaps/google-maps-services-java/commit/f12ce8a4057bcef0e8beb2653ccae712caa05277) -- Adding in unicode characters for MatchedSubstring offset and length. [`432c133`](https://github.com/googlemaps/google-maps-services-java/commit/432c1332c86a6f5a26a96686417e24c4be205032) +- Cleaning up Javadoc, and fixing class name typo. ( + Whups) [`7459bd2`](https://github.com/googlemaps/google-maps-services-java/commit/7459bd26441a60e3943f8e7ae8ddd74241afda5c) +- Use Oxford commas everywhere in + Javadoc [`f12ce8a`](https://github.com/googlemaps/google-maps-services-java/commit/f12ce8a4057bcef0e8beb2653ccae712caa05277) +- Adding in unicode characters for MatchedSubstring offset and + length. [`432c133`](https://github.com/googlemaps/google-maps-services-java/commit/432c1332c86a6f5a26a96686417e24c4be205032) ## [v0.2.1](https://github.com/googlemaps/google-maps-services-java/compare/v0.2.0...v0.2.1) - 2017-08-02 ### Merged - ./gradlew googleJavaFormat [`#305`](https://github.com/googlemaps/google-maps-services-java/pull/305) -- Update GeoApiContext.java - Exception using GAE [`#304`](https://github.com/googlemaps/google-maps-services-java/pull/304) -- Upgrade mockwebserver to 3.8.1 from OkHttp distribution [`#301`](https://github.com/googlemaps/google-maps-services-java/pull/301) -- Suppress deprecation warnings for radarSearchQuery [`#302`](https://github.com/googlemaps/google-maps-services-java/pull/302) -- README: Make central repo links do searches for this lib [`#300`](https://github.com/googlemaps/google-maps-services-java/pull/300) +- Update GeoApiContext.java - Exception using + GAE [`#304`](https://github.com/googlemaps/google-maps-services-java/pull/304) +- Upgrade mockwebserver to 3.8.1 from OkHttp + distribution [`#301`](https://github.com/googlemaps/google-maps-services-java/pull/301) +- Suppress deprecation warnings for + radarSearchQuery [`#302`](https://github.com/googlemaps/google-maps-services-java/pull/302) +- README: Make central repo links do searches for this + lib [`#300`](https://github.com/googlemaps/google-maps-services-java/pull/300) - Add .nb-gradle files to .gitignore [`#299`](https://github.com/googlemaps/google-maps-services-java/pull/299) - Spell 'adapter' consistently [`#298`](https://github.com/googlemaps/google-maps-services-java/pull/298) -- Update documentation publishing instructions [`#296`](https://github.com/googlemaps/google-maps-services-java/pull/296) -- GeocodingApiTest: fix missing quote in javadoc [`#294`](https://github.com/googlemaps/google-maps-services-java/pull/294) +- Update documentation publishing + instructions [`#296`](https://github.com/googlemaps/google-maps-services-java/pull/296) +- GeocodingApiTest: fix missing quote in + javadoc [`#294`](https://github.com/googlemaps/google-maps-services-java/pull/294) ### Commits -- Upgrade mockwebserver to 3.8.1 [`7d2282b`](https://github.com/googlemaps/google-maps-services-java/commit/7d2282be775badcabf6bd4af045ac9a6e090cfea) -- spell 'adapter' consistently [`5069f8a`](https://github.com/googlemaps/google-maps-services-java/commit/5069f8a8cba3f268731fd6e40bfd74c1f2abda03) -- README: Make central repo links do searches for this lib instead of going to main home page. [`d2e3245`](https://github.com/googlemaps/google-maps-services-java/commit/d2e3245992bde7b41b35a42977bb1270aa9fa76e) +- Upgrade mockwebserver to + 3.8.1 [`7d2282b`](https://github.com/googlemaps/google-maps-services-java/commit/7d2282be775badcabf6bd4af045ac9a6e090cfea) +- spell 'adapter' + consistently [`5069f8a`](https://github.com/googlemaps/google-maps-services-java/commit/5069f8a8cba3f268731fd6e40bfd74c1f2abda03) +- README: Make central repo links do searches for this lib instead of going to main home + page. [`d2e3245`](https://github.com/googlemaps/google-maps-services-java/commit/d2e3245992bde7b41b35a42977bb1270aa9fa76e) ## [v0.2.0](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.22...v0.2.0) - 2017-07-25 @@ -416,25 +556,33 @@ All notable changes to this project will be documented in this file. ### Commits -- Releasing Version 0.2.0 [`af0ca26`](https://github.com/googlemaps/google-maps-services-java/commit/af0ca2621ff8157a2be9f63988aa102f9613d6cd) -- Re-opening v0.2 in preparation for landing OkHttp3. [`b1e495e`](https://github.com/googlemaps/google-maps-services-java/commit/b1e495e376126138814da82fa771ea5b602cf981) +- Releasing Version + 0.2.0 [`af0ca26`](https://github.com/googlemaps/google-maps-services-java/commit/af0ca2621ff8157a2be9f63988aa102f9613d6cd) +- Re-opening v0.2 in preparation for landing + OkHttp3. [`b1e495e`](https://github.com/googlemaps/google-maps-services-java/commit/b1e495e376126138814da82fa771ea5b602cf981) ## [v0.1.22](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.21...v0.1.22) - 2017-07-24 ### Merged -- Applying `google-java-format` to the codebase. [`#291`](https://github.com/googlemaps/google-maps-services-java/pull/291) -- Fix issue where Runnable runs on the incorrect thread [`#290`](https://github.com/googlemaps/google-maps-services-java/pull/290) +- Applying `google-java-format` to the + codebase. [`#291`](https://github.com/googlemaps/google-maps-services-java/pull/291) +- Fix issue where Runnable runs on the incorrect + thread [`#290`](https://github.com/googlemaps/google-maps-services-java/pull/290) ### Fixed -- A quick respin to fix https://github.com/googlemaps/google-maps-services-java/issues/292 [`#292`](https://github.com/googlemaps/google-maps-services-java/issues/292) +- A quick respin to + fix https://github.com/googlemaps/google-maps-services-java/issues/292 [`#292`](https://github.com/googlemaps/google-maps-services-java/issues/292) ### Commits -- Reformat the static imports correctly [`94d8c8b`](https://github.com/googlemaps/google-maps-services-java/commit/94d8c8b1bf9a7963190ef90e8a80f2f338727f15) -- Making google-java-format easier to use. [`c9c006c`](https://github.com/googlemaps/google-maps-services-java/commit/c9c006cf226acb76ce75264a5b7701aebe9faa42) -- Runnable runs on the delegate ExecutorService [`eb81d7e`](https://github.com/googlemaps/google-maps-services-java/commit/eb81d7e318d41ee021f8addce7371904fd803dcd) +- Reformat the static imports + correctly [`94d8c8b`](https://github.com/googlemaps/google-maps-services-java/commit/94d8c8b1bf9a7963190ef90e8a80f2f338727f15) +- Making google-java-format easier to + use. [`c9c006c`](https://github.com/googlemaps/google-maps-services-java/commit/c9c006cf226acb76ce75264a5b7701aebe9faa42) +- Runnable runs on the delegate + ExecutorService [`eb81d7e`](https://github.com/googlemaps/google-maps-services-java/commit/eb81d7e318d41ee021f8addce7371904fd803dcd) ## [v0.1.21](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.20...v0.1.21) - 2017-07-03 @@ -442,49 +590,64 @@ All notable changes to this project will be documented in this file. - Marking Radar Search as deprecated [`#284`](https://github.com/googlemaps/google-maps-services-java/pull/284) - Converting tests to local server based. [`#282`](https://github.com/googlemaps/google-maps-services-java/pull/282) -- Converting Integration tests to Local Server tests [`#278`](https://github.com/googlemaps/google-maps-services-java/pull/278) +- Converting Integration tests to Local Server + tests [`#278`](https://github.com/googlemaps/google-maps-services-java/pull/278) - Fixing license declaration [`#277`](https://github.com/googlemaps/google-maps-services-java/pull/277) - Making PlaceDetailsRequest#Response public [`#276`](https://github.com/googlemaps/google-maps-services-java/pull/276) - Adding undocumented address types. [`#275`](https://github.com/googlemaps/google-maps-services-java/pull/275) - Testing Kita Ward. [`#274`](https://github.com/googlemaps/google-maps-services-java/pull/274) - Test fix [`#273`](https://github.com/googlemaps/google-maps-services-java/pull/273) -- Replacing hand rolled rate limiter with Gauva's Rate Limiter. [`#272`](https://github.com/googlemaps/google-maps-services-java/pull/272) -- Adding example configuration for SLF4J to the README [`#271`](https://github.com/googlemaps/google-maps-services-java/pull/271) +- Replacing hand rolled rate limiter with Gauva's Rate + Limiter. [`#272`](https://github.com/googlemaps/google-maps-services-java/pull/272) +- Adding example configuration for SLF4J to the + README [`#271`](https://github.com/googlemaps/google-maps-services-java/pull/271) - Making tests pass [`#269`](https://github.com/googlemaps/google-maps-services-java/pull/269) - Add light_rail_station enum type [`#268`](https://github.com/googlemaps/google-maps-services-java/pull/268) -- Fix for issues 218,170 - aded instance creator for EncodedPolyline to use with Gson [`#260`](https://github.com/googlemaps/google-maps-services-java/pull/260) +- Fix for issues 218,170 - aded instance creator for EncodedPolyline to use with + Gson [`#260`](https://github.com/googlemaps/google-maps-services-java/pull/260) ### Commits -- Converting Places API Integration tests to local server tests. [`72edd9c`](https://github.com/googlemaps/google-maps-services-java/commit/72edd9c12c6726ff755f9cd1c58cd7689dacc125) -- Moving large string blobs to resource files [`21d2be5`](https://github.com/googlemaps/google-maps-services-java/commit/21d2be5eb9bf8a40b60079708ef78310e694090a) -- Converted last API surfaces to localtests. [`9379324`](https://github.com/googlemaps/google-maps-services-java/commit/9379324ef7b95a38f089b63e26e901b5c70f9aaf) +- Converting Places API Integration tests to local server + tests. [`72edd9c`](https://github.com/googlemaps/google-maps-services-java/commit/72edd9c12c6726ff755f9cd1c58cd7689dacc125) +- Moving large string blobs to resource + files [`21d2be5`](https://github.com/googlemaps/google-maps-services-java/commit/21d2be5eb9bf8a40b60079708ef78310e694090a) +- Converted last API surfaces to + localtests. [`9379324`](https://github.com/googlemaps/google-maps-services-java/commit/9379324ef7b95a38f089b63e26e901b5c70f9aaf) ## [v0.1.20](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.19...v0.1.20) - 2017-04-13 ### Merged -- Solving performance problems in parallel processing [`#259`](https://github.com/googlemaps/google-maps-services-java/pull/259) +- Solving performance problems in parallel + processing [`#259`](https://github.com/googlemaps/google-maps-services-java/pull/259) - Fixing concurrency problem [`#255`](https://github.com/googlemaps/google-maps-services-java/pull/255) -- Fixing up ordering of signature calculation. [`#253`](https://github.com/googlemaps/google-maps-services-java/pull/253) +- Fixing up ordering of signature + calculation. [`#253`](https://github.com/googlemaps/google-maps-services-java/pull/253) ### Commits -- Created test for parallel signatures and cloned mac for each signature to avoid concurrency problems [`d9f55f9`](https://github.com/googlemaps/google-maps-services-java/commit/d9f55f91cac641407665a18f012ccb6a88db4445) -- Set maxQps on OKHttp dispatcher to not be limited to the default configuration [`fe422e9`](https://github.com/googlemaps/google-maps-services-java/commit/fe422e943eebc76e7592fa20e89b8f94f4d1fe48) -- Also catching exceptions during parallel signature to be more assertive [`4c41b2c`](https://github.com/googlemaps/google-maps-services-java/commit/4c41b2cbc8ab68d3e603d069a4e7ab5687496936) +- Created test for parallel signatures and cloned mac for each signature to avoid concurrency + problems [`d9f55f9`](https://github.com/googlemaps/google-maps-services-java/commit/d9f55f91cac641407665a18f012ccb6a88db4445) +- Set maxQps on OKHttp dispatcher to not be limited to the default + configuration [`fe422e9`](https://github.com/googlemaps/google-maps-services-java/commit/fe422e943eebc76e7592fa20e89b8f94f4d1fe48) +- Also catching exceptions during parallel signature to be more + assertive [`4c41b2c`](https://github.com/googlemaps/google-maps-services-java/commit/4c41b2cbc8ab68d3e603d069a4e7ab5687496936) ## [v0.1.19](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.18...v0.1.19) - 2017-03-28 ### Merged - Version 0.1.19 release [`#252`](https://github.com/googlemaps/google-maps-services-java/pull/252) -- Fix for https://github.com/googlemaps/google-maps-services-java/issues/248 [`#251`](https://github.com/googlemaps/google-maps-services-java/pull/251) +- Fix + for https://github.com/googlemaps/google-maps-services-java/issues/248 [`#251`](https://github.com/googlemaps/google-maps-services-java/pull/251) ### Commits -- Opening up development for v0.1.19 [`e2b474d`](https://github.com/googlemaps/google-maps-services-java/commit/e2b474d6a5191167251b83e77b1405651e775d23) -- Updating Javadoc link [`f9ade4e`](https://github.com/googlemaps/google-maps-services-java/commit/f9ade4ee593578c5d41903cf7c7a78f6f942e44f) +- Opening up development for + v0.1.19 [`e2b474d`](https://github.com/googlemaps/google-maps-services-java/commit/e2b474d6a5191167251b83e77b1405651e775d23) +- Updating Javadoc + link [`f9ade4e`](https://github.com/googlemaps/google-maps-services-java/commit/f9ade4ee593578c5d41903cf7c7a78f6f942e44f) ## [v0.1.18](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.17...v0.1.18) - 2017-03-24 @@ -493,27 +656,34 @@ All notable changes to this project will be documented in this file. - Creating version 0.1.18 [`#247`](https://github.com/googlemaps/google-maps-services-java/pull/247) - Updating gradle version [`#246`](https://github.com/googlemaps/google-maps-services-java/pull/246) - Updating versions and making tests pass [`#245`](https://github.com/googlemaps/google-maps-services-java/pull/245) -- Make PendingResult#await throw specific Exception [`#238`](https://github.com/googlemaps/google-maps-services-java/pull/238) -- Linkify travis badge and mavencentral badge in README [`#239`](https://github.com/googlemaps/google-maps-services-java/pull/239) +- Make PendingResult#await throw specific + Exception [`#238`](https://github.com/googlemaps/google-maps-services-java/pull/238) +- Linkify travis badge and mavencentral badge in + README [`#239`](https://github.com/googlemaps/google-maps-services-java/pull/239) - Update NearbySearchRequest.java [`#243`](https://github.com/googlemaps/google-maps-services-java/pull/243) - Update build.gradle to require 1.7 [`#236`](https://github.com/googlemaps/google-maps-services-java/pull/236) - Update TextSearchRequest.java [`#221`](https://github.com/googlemaps/google-maps-services-java/pull/221) - Fixing tests [`#223`](https://github.com/googlemaps/google-maps-services-java/pull/223) - Correct usage of GeoApiContext [`#222`](https://github.com/googlemaps/google-maps-services-java/pull/222) - Support `nearestRoads` API call [`#217`](https://github.com/googlemaps/google-maps-services-java/pull/217) -- Add support for address type 'postal_code_prefix'. [`#215`](https://github.com/googlemaps/google-maps-services-java/pull/215) +- Add support for address type ' + postal_code_prefix'. [`#215`](https://github.com/googlemaps/google-maps-services-java/pull/215) - Tidying up headers and imports [`#213`](https://github.com/googlemaps/google-maps-services-java/pull/213) - Save waypoints [`#204`](https://github.com/googlemaps/google-maps-services-java/pull/204) - Fixing up broken merge [`#212`](https://github.com/googlemaps/google-maps-services-java/pull/212) -- Change Java Util Logging to SLF4J and add SLF4J simple logger for tests [`#186`](https://github.com/googlemaps/google-maps-services-java/pull/186) +- Change Java Util Logging to SLF4J and add SLF4J simple logger for + tests [`#186`](https://github.com/googlemaps/google-maps-services-java/pull/186) - Update Javadoc reference [`#211`](https://github.com/googlemaps/google-maps-services-java/pull/211) - Open up Version 0.1.18 for development [`#210`](https://github.com/googlemaps/google-maps-services-java/pull/210) ### Commits -- Add waypoint optimization tests [`01f6a29`](https://github.com/googlemaps/google-maps-services-java/commit/01f6a29fa3250c22fdf93d77f9c5c75648387873) -- Remove unused ExceptionResult [`fa50c98`](https://github.com/googlemaps/google-maps-services-java/commit/fa50c988c614cf3540a1e79b74736ac3f35ce9f0) -- Support nearestRoads method from Roads API [`0829c7e`](https://github.com/googlemaps/google-maps-services-java/commit/0829c7e6cbd128faf2457b63bcef27730a76a9ff) +- Add waypoint optimization + tests [`01f6a29`](https://github.com/googlemaps/google-maps-services-java/commit/01f6a29fa3250c22fdf93d77f9c5c75648387873) +- Remove unused + ExceptionResult [`fa50c98`](https://github.com/googlemaps/google-maps-services-java/commit/fa50c988c614cf3540a1e79b74736ac3f35ce9f0) +- Support nearestRoads method from Roads + API [`0829c7e`](https://github.com/googlemaps/google-maps-services-java/commit/0829c7e6cbd128faf2457b63bcef27730a76a9ff) ## [v0.1.17](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.16...v0.1.17) - 2016-11-30 @@ -521,43 +691,61 @@ All notable changes to this project will be documented in this file. - Version 0.1.17 [`#209`](https://github.com/googlemaps/google-maps-services-java/pull/209) - Adding Custom Parameter handling [`#208`](https://github.com/googlemaps/google-maps-services-java/pull/208) -- Keep using ThreadPoolExecutor but increase number of threads [`#199`](https://github.com/googlemaps/google-maps-services-java/pull/199) -- Add waypoints method that takes in an array of LatLng [`#205`](https://github.com/googlemaps/google-maps-services-java/pull/205) +- Keep using ThreadPoolExecutor but increase number of + threads [`#199`](https://github.com/googlemaps/google-maps-services-java/pull/199) +- Add waypoints method that takes in an array of + LatLng [`#205`](https://github.com/googlemaps/google-maps-services-java/pull/205) - Add Light Rail Station to AddressType [`#197`](https://github.com/googlemaps/google-maps-services-java/pull/197) -- Update documentation links that were outdated. [`#194`](https://github.com/googlemaps/google-maps-services-java/pull/194) +- Update documentation links that were + outdated. [`#194`](https://github.com/googlemaps/google-maps-services-java/pull/194) - Add support for multiple type for PlacesApi [`#192`](https://github.com/googlemaps/google-maps-services-java/pull/192) -- Allow specific exception types to be retried or not retried [`#189`](https://github.com/googlemaps/google-maps-services-java/pull/189) +- Allow specific exception types to be retried or not + retried [`#189`](https://github.com/googlemaps/google-maps-services-java/pull/189) ### Commits -- Allow specific exception types to be retried or not retried. [`5f55a2b`](https://github.com/googlemaps/google-maps-services-java/commit/5f55a2b7b6a1b06390a779f56afe5a4d7546cfc4) -- Refactor reading test response file into a TestUtils. [`3f324a7`](https://github.com/googlemaps/google-maps-services-java/commit/3f324a744c65d27d7beee4e4ce6982611ec78342) -- Adding custom parameter pass through [`272734d`](https://github.com/googlemaps/google-maps-services-java/commit/272734d793df6708b1aafa7db4b0b5441f109efd) +- Allow specific exception types to be retried or not + retried. [`5f55a2b`](https://github.com/googlemaps/google-maps-services-java/commit/5f55a2b7b6a1b06390a779f56afe5a4d7546cfc4) +- Refactor reading test response file into a + TestUtils. [`3f324a7`](https://github.com/googlemaps/google-maps-services-java/commit/3f324a744c65d27d7beee4e4ce6982611ec78342) +- Adding custom parameter pass + through [`272734d`](https://github.com/googlemaps/google-maps-services-java/commit/272734d793df6708b1aafa7db4b0b5441f109efd) ## [v0.1.16](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.15...v0.1.16) - 2016-10-06 ### Merged -- Checking if OVER_QUERY_LIMIT is caused because Daily limit. In that c… [`#188`](https://github.com/googlemaps/google-maps-services-java/pull/188) -- Allow retries to be limited by number of retries, not time. [`#185`](https://github.com/googlemaps/google-maps-services-java/pull/185) -- Adding support for the Geolocation API call. [`#164`](https://github.com/googlemaps/google-maps-services-java/pull/164) -- Adding support for maneuver in the directions api. [`#50`](https://github.com/googlemaps/google-maps-services-java/pull/50) -- Fix poor resource management code (fixes #179) [`#181`](https://github.com/googlemaps/google-maps-services-java/pull/181) -- Add support for the 'permanently_closed' attribute in Place responses. [`#177`](https://github.com/googlemaps/google-maps-services-java/pull/177) +- Checking if OVER_QUERY_LIMIT is caused because Daily limit. In that + c… [`#188`](https://github.com/googlemaps/google-maps-services-java/pull/188) +- Allow retries to be limited by number of retries, not + time. [`#185`](https://github.com/googlemaps/google-maps-services-java/pull/185) +- Adding support for the Geolocation API + call. [`#164`](https://github.com/googlemaps/google-maps-services-java/pull/164) +- Adding support for maneuver in the directions + api. [`#50`](https://github.com/googlemaps/google-maps-services-java/pull/50) +- Fix poor resource management code (fixes + #179) [`#181`](https://github.com/googlemaps/google-maps-services-java/pull/181) +- Add support for the 'permanently_closed' attribute in Place + responses. [`#177`](https://github.com/googlemaps/google-maps-services-java/pull/177) - Set RateLimitExecutor thread name. [`#174`](https://github.com/googlemaps/google-maps-services-java/pull/174) - Cleaning up broken tests [`#167`](https://github.com/googlemaps/google-maps-services-java/pull/167) - Adds client-id example to README.md [`#166`](https://github.com/googlemaps/google-maps-services-java/pull/166) ### Fixed -- Merge pull request #181 from ben-manes/master [`#179`](https://github.com/googlemaps/google-maps-services-java/issues/179) -- Fix poor resource management code (fixes #179) [`#179`](https://github.com/googlemaps/google-maps-services-java/issues/179) +- Merge pull request #181 from + ben-manes/master [`#179`](https://github.com/googlemaps/google-maps-services-java/issues/179) +- Fix poor resource management code (fixes + #179) [`#179`](https://github.com/googlemaps/google-maps-services-java/issues/179) ### Commits -- Issue Fixes [`5281ed9`](https://github.com/googlemaps/google-maps-services-java/commit/5281ed9894a15c38fdddd9249cc8ca179d54763b) -- Pull Request Comments low hanging fruit. [`b2c718a`](https://github.com/googlemaps/google-maps-services-java/commit/b2c718a94828dfbb262105f46f8025efdb669902) -- ApiConfig now controls GET vs POST. [`f98913a`](https://github.com/googlemaps/google-maps-services-java/commit/f98913ab06475477298b3dfafea882883427fd5f) +- Issue + Fixes [`5281ed9`](https://github.com/googlemaps/google-maps-services-java/commit/5281ed9894a15c38fdddd9249cc8ca179d54763b) +- Pull Request Comments low hanging + fruit. [`b2c718a`](https://github.com/googlemaps/google-maps-services-java/commit/b2c718a94828dfbb262105f46f8025efdb669902) +- ApiConfig now controls GET vs + POST. [`f98913a`](https://github.com/googlemaps/google-maps-services-java/commit/f98913ab06475477298b3dfafea882883427fd5f) ## [v0.1.15](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.12...v0.1.15) - 2016-06-07 @@ -566,8 +754,10 @@ All notable changes to this project will be documented in this file. - Version 0.1.15 release [`#159`](https://github.com/googlemaps/google-maps-services-java/pull/159) - Break fixes [`#158`](https://github.com/googlemaps/google-maps-services-java/pull/158) - App engine support [`#154`](https://github.com/googlemaps/google-maps-services-java/pull/154) -- Increasing the precision of LatLng's toUrlValue [`#153`](https://github.com/googlemaps/google-maps-services-java/pull/153) -- Adding canonical literals for AddressComponentType [`#152`](https://github.com/googlemaps/google-maps-services-java/pull/152) +- Increasing the precision of LatLng's + toUrlValue [`#153`](https://github.com/googlemaps/google-maps-services-java/pull/153) +- Adding canonical literals for + AddressComponentType [`#152`](https://github.com/googlemaps/google-maps-services-java/pull/152) - Upgrade OkHttp [`#144`](https://github.com/googlemaps/google-maps-services-java/pull/144) ### Fixed @@ -576,25 +766,33 @@ All notable changes to this project will be documented in this file. ### Commits -- Adding support for Google App Engine [`e59c5d3`](https://github.com/googlemaps/google-maps-services-java/commit/e59c5d3e8116aa2393c7ed4cc0d53ad3669066f2) -- Adding unit test for canonical literals [`65e6997`](https://github.com/googlemaps/google-maps-services-java/commit/65e69970f23b649b15530232c513fe35cea4db17) -- Adding copyright notices. [`7755784`](https://github.com/googlemaps/google-maps-services-java/commit/7755784e0072403dd2c6e28db3877843ac20b177) +- Adding support for Google App + Engine [`e59c5d3`](https://github.com/googlemaps/google-maps-services-java/commit/e59c5d3e8116aa2393c7ed4cc0d53ad3669066f2) +- Adding unit test for canonical + literals [`65e6997`](https://github.com/googlemaps/google-maps-services-java/commit/65e69970f23b649b15530232c513fe35cea4db17) +- Adding copyright + notices. [`7755784`](https://github.com/googlemaps/google-maps-services-java/commit/7755784e0072403dd2c6e28db3877843ac20b177) ## [v0.1.12](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.11...v0.1.12) - 2016-03-24 ### Merged - Dropping flaky tests. [`#142`](https://github.com/googlemaps/google-maps-services-java/pull/142) -- Fix places autocomplete types parameter and introduced correct type enum [`#140`](https://github.com/googlemaps/google-maps-services-java/pull/140) -- distance matrix request - add traffic_model to request and durationInTraffic to response [`#139`](https://github.com/googlemaps/google-maps-services-java/pull/139) +- Fix places autocomplete types parameter and introduced correct type + enum [`#140`](https://github.com/googlemaps/google-maps-services-java/pull/140) +- distance matrix request - add traffic_model to request and durationInTraffic to + response [`#139`](https://github.com/googlemaps/google-maps-services-java/pull/139) - Commenting out Flaky test [`#136`](https://github.com/googlemaps/google-maps-services-java/pull/136) - Bug fixes and cleanups [`#135`](https://github.com/googlemaps/google-maps-services-java/pull/135) ### Commits -- Fix for https://github.com/googlemaps/google-maps-services-java/issues/75 [`99b8bd8`](https://github.com/googlemaps/google-maps-services-java/commit/99b8bd86f2f2cd639600447c05d2d9603ab58b76) -- Making Places API return AddressTypes instead of Strings. [`d567486`](https://github.com/googlemaps/google-maps-services-java/commit/d5674861aee3d96e0f7952f88afdc4feca94550e) -- Changing local_icon to localIcon, and reverting AddressType change. [`54b685e`](https://github.com/googlemaps/google-maps-services-java/commit/54b685ec3cd1cb71bd57765625b68c65934df861) +- Fix + for https://github.com/googlemaps/google-maps-services-java/issues/75 [`99b8bd8`](https://github.com/googlemaps/google-maps-services-java/commit/99b8bd86f2f2cd639600447c05d2d9603ab58b76) +- Making Places API return AddressTypes instead of + Strings. [`d567486`](https://github.com/googlemaps/google-maps-services-java/commit/d5674861aee3d96e0f7952f88afdc4feca94550e) +- Changing local_icon to localIcon, and reverting AddressType + change. [`54b685e`](https://github.com/googlemaps/google-maps-services-java/commit/54b685ec3cd1cb71bd57765625b68c65934df861) ## [v0.1.11](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.9...v0.1.11) - 2016-02-18 @@ -603,30 +801,38 @@ All notable changes to this project will be documented in this file. - Adding most of Places API, plus tidy ups. [`#133`](https://github.com/googlemaps/google-maps-services-java/pull/133) - Fixing analytics. [`#130`](https://github.com/googlemaps/google-maps-services-java/pull/130) - Making the fares tests pass. [`#129`](https://github.com/googlemaps/google-maps-services-java/pull/129) -- NPE check for route fares, and a better test for permanently closed. [`#128`](https://github.com/googlemaps/google-maps-services-java/pull/128) -- Adding tests: UTF8 return parsing and permanently closed [`#127`](https://github.com/googlemaps/google-maps-services-java/pull/127) +- NPE check for route fares, and a better test for permanently + closed. [`#128`](https://github.com/googlemaps/google-maps-services-java/pull/128) +- Adding tests: UTF8 return parsing and permanently + closed [`#127`](https://github.com/googlemaps/google-maps-services-java/pull/127) - Making Travis compile again. [`#125`](https://github.com/googlemaps/google-maps-services-java/pull/125) - Tidyup tests + better javadoc. [`#124`](https://github.com/googlemaps/google-maps-services-java/pull/124) -- Introducing Geocoded Waypoints into Directions API result. [`#118`](https://github.com/googlemaps/google-maps-services-java/pull/118) +- Introducing Geocoded Waypoints into Directions API + result. [`#118`](https://github.com/googlemaps/google-maps-services-java/pull/118) - Places API test fixes [`#115`](https://github.com/googlemaps/google-maps-services-java/pull/115) ### Commits -- Simplified Directions API to just one result type [`f1f73ba`](https://github.com/googlemaps/google-maps-services-java/commit/f1f73badbd38da3245c25fca8f50dfc32cca4912) -- Splitting the full result from just the routes. [`13e24c1`](https://github.com/googlemaps/google-maps-services-java/commit/13e24c1bfffc112c53fcd0e8d48f876a2d68854d) -- Introducing GeocodedWaypointStatus. [`b05e5ae`](https://github.com/googlemaps/google-maps-services-java/commit/b05e5aebbac63179d18569e76a79c896b9e91f40) +- Simplified Directions API to just one result + type [`f1f73ba`](https://github.com/googlemaps/google-maps-services-java/commit/f1f73badbd38da3245c25fca8f50dfc32cca4912) +- Splitting the full result from just the + routes. [`13e24c1`](https://github.com/googlemaps/google-maps-services-java/commit/13e24c1bfffc112c53fcd0e8d48f876a2d68854d) +- Introducing + GeocodedWaypointStatus. [`b05e5ae`](https://github.com/googlemaps/google-maps-services-java/commit/b05e5aebbac63179d18569e76a79c896b9e91f40) ## [v0.1.9](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.8...v0.1.9) - 2015-11-10 ### Merged -- Added traffic_model parameter to directions requests [`#112`](https://github.com/googlemaps/google-maps-services-java/pull/112) +- Added traffic_model parameter to directions + requests [`#112`](https://github.com/googlemaps/google-maps-services-java/pull/112) - Adding Subway Station [`#111`](https://github.com/googlemaps/google-maps-services-java/pull/111) - Places API release - version 0.1.8 [`#110`](https://github.com/googlemaps/google-maps-services-java/pull/110) ### Commits -- version bump [`dfa0a2f`](https://github.com/googlemaps/google-maps-services-java/commit/dfa0a2fa2ed9e1ef5974239dadedd20a14aa90a8) +- version + bump [`dfa0a2f`](https://github.com/googlemaps/google-maps-services-java/commit/dfa0a2fa2ed9e1ef5974239dadedd20a14aa90a8) ## [v0.1.8](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.7...v0.1.8) - 2015-10-14 @@ -636,15 +842,21 @@ All notable changes to this project will be documented in this file. - Adding Places API [`#106`](https://github.com/googlemaps/google-maps-services-java/pull/106) - Update README.md [`#103`](https://github.com/googlemaps/google-maps-services-java/pull/103) - Making tests happy. [`#100`](https://github.com/googlemaps/google-maps-services-java/pull/100) -- Added channel parameter to request (issue #77) [`#97`](https://github.com/googlemaps/google-maps-services-java/pull/97) +- Added channel parameter to request (issue + #77) [`#97`](https://github.com/googlemaps/google-maps-services-java/pull/97) - Multiple failed test fixes [`#89`](https://github.com/googlemaps/google-maps-services-java/pull/89) -- For issue #87 NumberFormatException when parsing SpeedLimit [`#88`](https://github.com/googlemaps/google-maps-services-java/pull/88) +- For issue #87 NumberFormatException when parsing + SpeedLimit [`#88`](https://github.com/googlemaps/google-maps-services-java/pull/88) ### Commits -- Fix for issue #87 NumberFormatException when parsing SpeedLimit response for nonmetric countries. Changed SpeedLimit.speedLimit property from long to double. Added unit tests. [`17342b0`](https://github.com/googlemaps/google-maps-services-java/commit/17342b0b455da698ee3e2d2bddb1d2fbabbb9aa5) -- Code tidyup [`e469d56`](https://github.com/googlemaps/google-maps-services-java/commit/e469d5623eb1ebd50fe9a9105bc56677b77c2550) -- Enable using API Keys as systemProperties. [`7e030c4`](https://github.com/googlemaps/google-maps-services-java/commit/7e030c493295061ee2c92288b60b621d9aec3bcb) +- Fix for issue #87 NumberFormatException when parsing SpeedLimit response for nonmetric countries. Changed + SpeedLimit.speedLimit property from long to double. Added unit + tests. [`17342b0`](https://github.com/googlemaps/google-maps-services-java/commit/17342b0b455da698ee3e2d2bddb1d2fbabbb9aa5) +- Code + tidyup [`e469d56`](https://github.com/googlemaps/google-maps-services-java/commit/e469d5623eb1ebd50fe9a9105bc56677b77c2550) +- Enable using API Keys as + systemProperties. [`7e030c4`](https://github.com/googlemaps/google-maps-services-java/commit/7e030c493295061ee2c92288b60b621d9aec3bcb) ## [v0.1.7](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.6...v0.1.7) - 2015-05-05 @@ -652,8 +864,10 @@ All notable changes to this project will be documented in this file. - Added postal_code_prefix (Closes #48) [`#86`](https://github.com/googlemaps/google-maps-services-java/pull/86) - Fixes vehicle type field name [`#81`](https://github.com/googlemaps/google-maps-services-java/pull/81) -- Added some returning but not documented AddressType. [`#78`](https://github.com/googlemaps/google-maps-services-java/pull/78) -- Updated build rules to execute M4W + keyed reqs together [`#80`](https://github.com/googlemaps/google-maps-services-java/pull/80) +- Added some returning but not documented + AddressType. [`#78`](https://github.com/googlemaps/google-maps-services-java/pull/78) +- Updated build rules to execute M4W + keyed reqs + together [`#80`](https://github.com/googlemaps/google-maps-services-java/pull/80) ### Fixed @@ -662,9 +876,12 @@ All notable changes to this project will be documented in this file. ### Commits -- Bumped timeouts for Raods API tests [`57fe118`](https://github.com/googlemaps/google-maps-services-java/commit/57fe118ba46572349f5ac33063be15e332add23c) -- JavaDoc in README to 0.1.6 [`270be23`](https://github.com/googlemaps/google-maps-services-java/commit/270be23a25851763530b6faf18545da6db9d3043) -- Adding @NicolasPoirier to AUTH/CONTRIB [`835fd60`](https://github.com/googlemaps/google-maps-services-java/commit/835fd6092ed26a2730b5304da71fe0c6d739c767) +- Bumped timeouts for Raods API + tests [`57fe118`](https://github.com/googlemaps/google-maps-services-java/commit/57fe118ba46572349f5ac33063be15e332add23c) +- JavaDoc in README to + 0.1.6 [`270be23`](https://github.com/googlemaps/google-maps-services-java/commit/270be23a25851763530b6faf18545da6db9d3043) +- Adding @NicolasPoirier to + AUTH/CONTRIB [`835fd60`](https://github.com/googlemaps/google-maps-services-java/commit/835fd6092ed26a2730b5304da71fe0c6d739c767) ## [v0.1.6](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.5...v0.1.6) - 2015-03-04 @@ -679,15 +896,20 @@ All notable changes to this project will be documented in this file. - Adds Proxy support to GeoApiContext [`#67`](https://github.com/googlemaps/google-maps-services-java/pull/67) - Fixed broken tests [`#64`](https://github.com/googlemaps/google-maps-services-java/pull/64) - final on String in model [`#63`](https://github.com/googlemaps/google-maps-services-java/pull/63) -- :moneybag: Transit Fares in Directions & DistanceMatrix [`#60`](https://github.com/googlemaps/google-maps-services-java/pull/60) +- :moneybag: Transit Fares in Directions & + DistanceMatrix [`#60`](https://github.com/googlemaps/google-maps-services-java/pull/60) - Fixed broken test caused by API data [`#61`](https://github.com/googlemaps/google-maps-services-java/pull/61) -- Added ApiConfig for more configurable API endpoints [`#58`](https://github.com/googlemaps/google-maps-services-java/pull/58) +- Added ApiConfig for more configurable API + endpoints [`#58`](https://github.com/googlemaps/google-maps-services-java/pull/58) ### Commits -- :car: Added Roads API [`a69e13c`](https://github.com/googlemaps/google-maps-services-java/commit/a69e13c5ec38020a607c5b2562b84ee197c7d2ce) -- Optimized lookup() method, adding more types. [`b0b1301`](https://github.com/googlemaps/google-maps-services-java/commit/b0b1301e7664d6a395d4d44ac64b8ad075bcf170) -- Added transit fares to directions API [`efb08a9`](https://github.com/googlemaps/google-maps-services-java/commit/efb08a9838cc75e37fd2169f3ad7515c1c9a584d) +- :car: Added Roads + API [`a69e13c`](https://github.com/googlemaps/google-maps-services-java/commit/a69e13c5ec38020a607c5b2562b84ee197c7d2ce) +- Optimized lookup() method, adding more + types. [`b0b1301`](https://github.com/googlemaps/google-maps-services-java/commit/b0b1301e7664d6a395d4d44ac64b8ad075bcf170) +- Added transit fares to directions + API [`efb08a9`](https://github.com/googlemaps/google-maps-services-java/commit/efb08a9838cc75e37fd2169f3ad7515c1c9a584d) ## [v0.1.5](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.4...v0.1.5) - 2015-01-19 @@ -695,62 +917,84 @@ All notable changes to this project will be documented in this file. - :wrench: Updated GSON dep to working version [`#57`](https://github.com/googlemaps/google-maps-services-java/pull/57) - Change req to Java 1.6 [`#56`](https://github.com/googlemaps/google-maps-services-java/pull/56) -- Response parsing and dependency on StandardCharsets class [`#46`](https://github.com/googlemaps/google-maps-services-java/pull/46) +- Response parsing and dependency on StandardCharsets + class [`#46`](https://github.com/googlemaps/google-maps-services-java/pull/46) ### Commits -- dependency on java.nio removed [`07a3098`](https://github.com/googlemaps/google-maps-services-java/commit/07a30986894a2b5735181623265c1ce46d8621f9) -- Adding support for maneuver in the directions api. [`0f7117d`](https://github.com/googlemaps/google-maps-services-java/commit/0f7117d685056db5954c8ffb57529b2f6e3d34cc) -- a bit smaller buffer [`267eb3d`](https://github.com/googlemaps/google-maps-services-java/commit/267eb3d530524a79197df2fed2d8afd8a1eef2f4) +- dependency on java.nio + removed [`07a3098`](https://github.com/googlemaps/google-maps-services-java/commit/07a30986894a2b5735181623265c1ce46d8621f9) +- Adding support for maneuver in the directions + api. [`0f7117d`](https://github.com/googlemaps/google-maps-services-java/commit/0f7117d685056db5954c8ffb57529b2f6e3d34cc) +- a bit smaller + buffer [`267eb3d`](https://github.com/googlemaps/google-maps-services-java/commit/267eb3d530524a79197df2fed2d8afd8a1eef2f4) ## [v0.1.4](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.3...v0.1.4) - 2014-11-04 ### Merged -- Minor cleanups, refactor RateLimitExecutorService. [`#41`](https://github.com/googlemaps/google-maps-services-java/pull/41) -- Add @nutsiepully, github usernames to CONTRIBUTORS [`#43`](https://github.com/googlemaps/google-maps-services-java/pull/43) +- Minor cleanups, refactor + RateLimitExecutorService. [`#41`](https://github.com/googlemaps/google-maps-services-java/pull/41) +- Add @nutsiepully, github usernames to + CONTRIBUTORS [`#43`](https://github.com/googlemaps/google-maps-services-java/pull/43) - Porting code to be compatible with Java 1.6 [`#42`](https://github.com/googlemaps/google-maps-services-java/pull/42) -- Fixing .gitignore to remove iml and intellij idea files. [`#40`](https://github.com/googlemaps/google-maps-services-java/pull/40) +- Fixing .gitignore to remove iml and intellij idea + files. [`#40`](https://github.com/googlemaps/google-maps-services-java/pull/40) - Make DistanceMatrixElementStatus an enum. [`#39`](https://github.com/googlemaps/google-maps-services-java/pull/39) - Add extra safety to unmarshaling to enums. [`#38`](https://github.com/googlemaps/google-maps-services-java/pull/38) ### Commits -- Incorporating formatting feedback. [`98785ca`](https://github.com/googlemaps/google-maps-services-java/commit/98785ca551959b8e77fdfec10ea8955fe3878011) -- :sparkle: clarified support text [`2c4a7cc`](https://github.com/googlemaps/google-maps-services-java/commit/2c4a7cc2c9829c51726260e925fe61d4128b97d8) -- javadoc -> 0.1.3 [`1d144d1`](https://github.com/googlemaps/google-maps-services-java/commit/1d144d1796a9c60dec37d379ca695fa2fa9e3d47) +- Incorporating formatting + feedback. [`98785ca`](https://github.com/googlemaps/google-maps-services-java/commit/98785ca551959b8e77fdfec10ea8955fe3878011) +- :sparkle: clarified support + text [`2c4a7cc`](https://github.com/googlemaps/google-maps-services-java/commit/2c4a7cc2c9829c51726260e925fe61d4128b97d8) +- javadoc -> + 0.1.3 [`1d144d1`](https://github.com/googlemaps/google-maps-services-java/commit/1d144d1796a9c60dec37d379ca695fa2fa9e3d47) ## [v0.1.3](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.2...v0.1.3) - 2014-10-03 ### Merged -- Added logging to the rate limiting test to aid debugging if it fails again [`#36`](https://github.com/googlemaps/google-maps-services-java/pull/36) -- Don't throw exceptions when the server returns something we're not expecting. [`#34`](https://github.com/googlemaps/google-maps-services-java/pull/34) +- Added logging to the rate limiting test to aid debugging if it fails + again [`#36`](https://github.com/googlemaps/google-maps-services-java/pull/36) +- Don't throw exceptions when the server returns something we're not + expecting. [`#34`](https://github.com/googlemaps/google-maps-services-java/pull/34) - Fix indentation. [`#33`](https://github.com/googlemaps/google-maps-services-java/pull/33) -- Better handling of more address types and address component types [`#32`](https://github.com/googlemaps/google-maps-services-java/pull/32) +- Better handling of more address types and address component + types [`#32`](https://github.com/googlemaps/google-maps-services-java/pull/32) - Fixing a typo in ReadMe.md [`#29`](https://github.com/googlemaps/google-maps-services-java/pull/29) -- A bit more Maps for Business -> Maps for Work renaming. [`#27`](https://github.com/googlemaps/google-maps-services-java/pull/27) -- Updates to the ReadMe. Cleaning up the original documentation, and clarifying some things around support/contribution. [`#26`](https://github.com/googlemaps/google-maps-services-java/pull/26) +- A bit more Maps for Business -> Maps for Work + renaming. [`#27`](https://github.com/googlemaps/google-maps-services-java/pull/27) +- Updates to the ReadMe. Cleaning up the original documentation, and clarifying some things around + support/contribution. [`#26`](https://github.com/googlemaps/google-maps-services-java/pull/26) - Remove elevation LatLng join code [`#25`](https://github.com/googlemaps/google-maps-services-java/pull/25) ### Commits -- Fix indentation. Remove unneeded import/impl of UrlValue. [`3f46121`](https://github.com/googlemaps/google-maps-services-java/commit/3f46121a8cacbe3c4abfc1cf1b2828b270ef8dcf) -- Updates to the ReadMe file [`989be08`](https://github.com/googlemaps/google-maps-services-java/commit/989be08cc55e370884a81e4a5bd4ef2987749762) -- Add instructions for generating and pushing javadoc. [`be0b96e`](https://github.com/googlemaps/google-maps-services-java/commit/be0b96e16c522d5b03f2c10524646340acfe25cf) +- Fix indentation. Remove unneeded import/impl of + UrlValue. [`3f46121`](https://github.com/googlemaps/google-maps-services-java/commit/3f46121a8cacbe3c4abfc1cf1b2828b270ef8dcf) +- Updates to the ReadMe + file [`989be08`](https://github.com/googlemaps/google-maps-services-java/commit/989be08cc55e370884a81e4a5bd4ef2987749762) +- Add instructions for generating and pushing + javadoc. [`be0b96e`](https://github.com/googlemaps/google-maps-services-java/commit/be0b96e16c522d5b03f2c10524646340acfe25cf) ## [v0.1.2](https://github.com/googlemaps/google-maps-services-java/compare/v0.1.1...v0.1.2) - 2014-09-16 ### Merged -- :vertical_traffic_light: added over_query_limit to retry logic [`#22`](https://github.com/googlemaps/google-maps-services-java/pull/22) +- :vertical_traffic_light: added over_query_limit to retry + logic [`#22`](https://github.com/googlemaps/google-maps-services-java/pull/22) - :curly_loop: fixed long-running threads [`#21`](https://github.com/googlemaps/google-maps-services-java/pull/21) ### Commits -- :curly_loop: extracted threadFactory [`14c7341`](https://github.com/googlemaps/google-maps-services-java/commit/14c7341afe6fdf9b30be9be808f0be2cb199f8c1) -- added over_query_limit to retry logic [`c074753`](https://github.com/googlemaps/google-maps-services-java/commit/c0747535ff208a846f2f77d0babc4530a922c6a9) -- :curly_loop: updated comment regarding thread termination [`d5af2a1`](https://github.com/googlemaps/google-maps-services-java/commit/d5af2a1764973e384c0da63e85adf8e3d75b285e) +- :curly_loop: extracted + threadFactory [`14c7341`](https://github.com/googlemaps/google-maps-services-java/commit/14c7341afe6fdf9b30be9be808f0be2cb199f8c1) +- added over_query_limit to retry + logic [`c074753`](https://github.com/googlemaps/google-maps-services-java/commit/c0747535ff208a846f2f77d0babc4530a922c6a9) +- :curly_loop: updated comment regarding thread + termination [`d5af2a1`](https://github.com/googlemaps/google-maps-services-java/commit/d5af2a1764973e384c0da63e85adf8e3d75b285e) ## v0.1.1 - 2014-09-12 @@ -758,10 +1002,12 @@ All notable changes to this project will be documented in this file. - Fixed signing rules to allow travis to run [`#20`](https://github.com/googlemaps/google-maps-services-java/pull/20) - Added maven deployment tasks [`#19`](https://github.com/googlemaps/google-maps-services-java/pull/19) -- Updated partial match test to use a working query [`#18`](https://github.com/googlemaps/google-maps-services-java/pull/18) +- Updated partial match test to use a working + query [`#18`](https://github.com/googlemaps/google-maps-services-java/pull/18) - Update README.md [`#16`](https://github.com/googlemaps/google-maps-services-java/pull/16) - Enable test coverage reports with jacoco [`#13`](https://github.com/googlemaps/google-maps-services-java/pull/13) -- Don't use local hostname for MockWebServer's base URL. [`#14`](https://github.com/googlemaps/google-maps-services-java/pull/14) +- Don't use local hostname for MockWebServer's base + URL. [`#14`](https://github.com/googlemaps/google-maps-services-java/pull/14) - added NOT_FOUND exception (closes #10) [`#11`](https://github.com/googlemaps/google-maps-services-java/pull/11) - :construction: fixed javadoc warnings [`#9`](https://github.com/googlemaps/google-maps-services-java/pull/9) - Updating copyrights and license [`#8`](https://github.com/googlemaps/google-maps-services-java/pull/8) @@ -775,11 +1021,15 @@ All notable changes to this project will be documented in this file. ### Fixed -- Merge pull request #11 from markmcd/issue-10 [`#10`](https://github.com/googlemaps/google-maps-services-java/issues/10) +- Merge pull request #11 from + markmcd/issue-10 [`#10`](https://github.com/googlemaps/google-maps-services-java/issues/10) - added NOT_FOUND exception (closes #10) [`#10`](https://github.com/googlemaps/google-maps-services-java/issues/10) ### Commits -- Initial import of Java code [`b577f30`](https://github.com/googlemaps/google-maps-services-java/commit/b577f300c18b88674a375018bfc4c20daca1f24b) -- Using the /* */ format instead of // [`0816981`](https://github.com/googlemaps/google-maps-services-java/commit/081698119beb67d76d0808db23bbc5fb615b08a8) -- :gift: Added gradle wrapper [`d669a10`](https://github.com/googlemaps/google-maps-services-java/commit/d669a10855a019db6332f3cbaf354d2d24e26a22) +- Initial import of Java + code [`b577f30`](https://github.com/googlemaps/google-maps-services-java/commit/b577f300c18b88674a375018bfc4c20daca1f24b) +- Using the /* */ format instead + of // [`0816981`](https://github.com/googlemaps/google-maps-services-java/commit/081698119beb67d76d0808db23bbc5fb615b08a8) +- :gift: Added gradle + wrapper [`d669a10`](https://github.com/googlemaps/google-maps-services-java/commit/d669a10855a019db6332f3cbaf354d2d24e26a22) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f8b12cb55..e35f6ac15 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -24,6 +24,7 @@ conduct, which may have additional detailed expectations for participants. Most of those projects will use our [modified Contributor Covenant][]. [may adopt]: https://opensource.google/docs/releasing/preparing/#conduct + [modified Contributor Covenant]: https://opensource.google/docs/releasing/template/CODE_OF_CONDUCT/ ## Resolve peacefully diff --git a/README.md b/README.md index e899acfdc..6154691b5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# This is the forked version of the original repository. And few test cases are added to improve the code coverage. + +### Original repository: https://github.com/googlemaps/google-maps-services-java + Java Client for Google Maps Services ==================================== @@ -35,14 +39,18 @@ to usage of the APIs when they're accessed through this library. - A Google Maps API key. ## API keys -Each Google Maps Web Service request requires an API key. API keys are generated in the 'Credentials' page of the 'APIs & Services' tab of Google Cloud console. -For even more information on getting started with Google Maps Platform and generating an API key, see [Get Started with Google Maps Platform](https://developers.google.com/maps/gmp-get-started) in our docs. +Each Google Maps Web Service request requires an API key. API keys are generated in the 'Credentials' page of the ' +APIs & Services' tab of Google Cloud console. + +For even more information on getting started with Google Maps Platform and generating an API key, +see [Get Started with Google Maps Platform](https://developers.google.com/maps/gmp-get-started) in our docs. ### API Key Security The Java Client for Google Maps Services is designed for use in both server and Android applications. -In either case, it is important to add [API key restrictions](https://developers.google.com/maps/api-security-best-practices?hl=it) +In either case, it is important to +add [API key restrictions](https://developers.google.com/maps/api-security-best-practices?hl=it) to improve the security of your API key. Additional security measures, such as hiding your key from version control, should also be put in place to further improve the security of your API key. @@ -98,6 +106,7 @@ You can find the latest version at the top of this README or by [searching Maven Central](https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22google-maps-services%22). ## Developer Documentation + View the [javadoc](https://www.javadoc.io/doc/com.google.maps/google-maps-services). Additional documentation for the included web services is available at @@ -142,7 +151,8 @@ For more usage examples, check out [the tests](src/test/java/com/google/maps). ### Google App Engine Support -To use Google App Engine with this client library add the latest [App Engine dependency](https://mvnrepository.com/artifact/com.google.appengine/appengine-api-1.0-sdk) +To use Google App Engine with this client library add the +latest [App Engine dependency](https://mvnrepository.com/artifact/com.google.appengine/appengine-api-1.0-sdk) to your `build.gradle` file: ```groovy @@ -169,7 +179,9 @@ based strategy. Never sleep between requests again! By default, requests are sent at the expected rate limits for each web service, typically 50 queries per second for free users. If you want to speed up or slow down requests, you can do that too, using `new GeoApiContext.Builder().queryRateLimit(qps).build()`. -Note that you still need to manually handle the [delay between the initial request and successive pages](https://developers.google.com/places/web-service/search#PlaceSearchPaging) when you're paging through multiple result sets. +Note that you still need to manually handle +the [delay between the initial request and successive pages](https://developers.google.com/places/web-service/search#PlaceSearchPaging) +when you're paging through multiple result sets. ### Retry on Failure @@ -243,18 +255,33 @@ contribute, please read [How to Contribute][contrib]. [apikey]: https://developers.google.com/maps/faq#keysystem + [clientid]: https://developers.google.com/maps/documentation/business/webservices/auth + [contrib]: https://github.com/googlemaps/google-maps-services-java/blob/main/CONTRIB.md + [Directions API]: https://developers.google.com/maps/documentation/directions + [directions-key]: https://developers.google.com/maps/documentation/directions/get-api-key#key + [directions-client-id]: https://developers.google.com/maps/documentation/directions/get-api-key#client-id + [Distance Matrix API]: https://developers.google.com/maps/documentation/distancematrix + [Elevation API]: https://developers.google.com/maps/documentation/elevation + [Geocoding API]: https://developers.google.com/maps/documentation/geocoding + [Google Maps API Web Services]: https://developers.google.com/maps/apis-by-platform#web_service_apis + [issues]: https://github.com/googlemaps/google-maps-services-java/issues + [Maps Static API]: https://developers.google.com/maps/documentation/maps-static/ + [Places API]: https://developers.google.com/places/web-service/ + [Time Zone API]: https://developers.google.com/maps/documentation/timezone + [Roads API]: https://developers.google.com/maps/documentation/roads + [Making the most of the Google Maps Web Service APIs]: https://maps-apis.googleblog.com/2016/09/making-most-of-google-maps-web-service.html diff --git a/build.gradle b/build.gradle index 1cf7fc735..dfe933930 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,14 @@ import org.apache.tools.ant.filters.ReplaceTokens + import java.time.Duration buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3' - } + repositories { + mavenCentral() + } + dependencies { + classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3' + } } @@ -34,6 +35,10 @@ repositories { mavenCentral() } +configurations { + liquibaseRuntime.exclude group: "org.codehaus.groovy" +} + task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from 'build/docs/javadoc' @@ -64,6 +69,13 @@ dependencies { testImplementation 'org.json:json:20231013' testImplementation 'io.opencensus:opencensus-impl:0.31.1' testImplementation "org.mockito:mockito-inline:5.2.0" + liquibaseRuntime('org.liquibase:liquibase-core:3.8.1') + liquibaseRuntime('org.codehaus.groovy:groovy-all:3.0.3') + liquibaseRuntime 'org.postgresql:postgresql' + liquibaseRuntime('org.liquibase:liquibase-groovy-dsl:2.1.2') + liquibaseRuntime('org.liquibase.ext:liquibase-hibernate5:3.10.2') + liquibaseRuntime('org.springframework.boot:spring-boot-starter-data-jpa') + liquibaseRuntime sourceSets.main.output } task updateVersion(type: Copy) { @@ -96,6 +108,7 @@ java { javadoc { exclude '**/internal/**' def currentJavaVersion = org.gradle.api.JavaVersion.current() + options.encoding "UTF-8" } jacoco { diff --git a/gradle.properties b/gradle.properties index aca88b207..fc76b1f6a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,6 @@ signing.keyId= signing.password= signing.secretKeyRingFile= - sonatypeUsername= sonatypePassword= - githubPassword= diff --git a/src/main/java/com/google/maps/DirectionsApi.java b/src/main/java/com/google/maps/DirectionsApi.java index 415ece739..8f8e9d632 100644 --- a/src/main/java/com/google/maps/DirectionsApi.java +++ b/src/main/java/com/google/maps/DirectionsApi.java @@ -63,34 +63,6 @@ public static DirectionsApiRequest getDirections( return new DirectionsApiRequest(context).origin(origin).destination(destination); } - public static class Response implements ApiResponse { - public String status; - public String errorMessage; - public GeocodedWaypoint[] geocodedWaypoints; - public DirectionsRoute[] routes; - - @Override - public boolean successful() { - return "OK".equals(status); - } - - @Override - public DirectionsResult getResult() { - DirectionsResult result = new DirectionsResult(); - result.geocodedWaypoints = geocodedWaypoints; - result.routes = routes; - return result; - } - - @Override - public ApiException getError() { - if (successful()) { - return null; - } - return ApiException.from(status, errorMessage); - } - } - /** * Directions may be calculated that adhere to certain restrictions. This is configured by calling * {@link com.google.maps.DirectionsApiRequest#avoid} or {@link @@ -132,4 +104,32 @@ public String toUrlValue() { return restriction; } } + + public static class Response implements ApiResponse { + public String status; + public String errorMessage; + public GeocodedWaypoint[] geocodedWaypoints; + public DirectionsRoute[] routes; + + @Override + public boolean successful() { + return "OK".equals(status); + } + + @Override + public DirectionsResult getResult() { + DirectionsResult result = new DirectionsResult(); + result.geocodedWaypoints = geocodedWaypoints; + result.routes = routes; + return result; + } + + @Override + public ApiException getError() { + if (successful()) { + return null; + } + return ApiException.from(status, errorMessage); + } + } } diff --git a/src/main/java/com/google/maps/DirectionsApiRequest.java b/src/main/java/com/google/maps/DirectionsApiRequest.java index c10186cf2..a2b5645ed 100644 --- a/src/main/java/com/google/maps/DirectionsApiRequest.java +++ b/src/main/java/com/google/maps/DirectionsApiRequest.java @@ -18,26 +18,20 @@ import static com.google.maps.internal.StringJoin.join; import static java.util.Objects.requireNonNull; -import com.google.maps.model.DirectionsResult; -import com.google.maps.model.LatLng; -import com.google.maps.model.TrafficModel; -import com.google.maps.model.TransitMode; -import com.google.maps.model.TransitRoutingPreference; -import com.google.maps.model.TravelMode; -import com.google.maps.model.Unit; +import com.google.maps.model.*; import java.time.Instant; /** Request for the Directions API. */ public class DirectionsApiRequest extends PendingResultBase { + protected boolean optimizeWaypoints; + protected Waypoint[] waypoints; + public DirectionsApiRequest(GeoApiContext context) { super(context, DirectionsApi.API_CONFIG, DirectionsApi.Response.class); } - protected boolean optimizeWaypoints; - protected Waypoint[] waypoints; - @Override protected void validateRequest() { if (!params().containsKey("origin")) { diff --git a/src/main/java/com/google/maps/DistanceMatrixApiRequest.java b/src/main/java/com/google/maps/DistanceMatrixApiRequest.java index 1f1e63439..a0f9a1993 100644 --- a/src/main/java/com/google/maps/DistanceMatrixApiRequest.java +++ b/src/main/java/com/google/maps/DistanceMatrixApiRequest.java @@ -19,14 +19,9 @@ import com.google.maps.DirectionsApi.RouteRestriction; import com.google.maps.DistanceMatrixApi.Response; -import com.google.maps.model.DistanceMatrix; -import com.google.maps.model.LatLng; -import com.google.maps.model.TrafficModel; -import com.google.maps.model.TransitMode; -import com.google.maps.model.TransitRoutingPreference; -import com.google.maps.model.TravelMode; -import com.google.maps.model.Unit; +import com.google.maps.model.*; import java.time.Instant; +import java.util.Arrays; /** A request to the Distance Matrix API. */ public class DistanceMatrixApiRequest @@ -102,10 +97,11 @@ public DistanceMatrixApiRequest destinations(LatLng... points) { * @return Returns this {@code DistanceMatrixApiRequest} for call chaining. */ public DistanceMatrixApiRequest mode(TravelMode mode) { - if (TravelMode.DRIVING.equals(mode) - || TravelMode.WALKING.equals(mode) - || TravelMode.BICYCLING.equals(mode) - || TravelMode.TRANSIT.equals(mode)) { + TravelMode[] validModes = { + TravelMode.DRIVING, TravelMode.WALKING, TravelMode.BICYCLING, TravelMode.TRANSIT + }; + + if (Arrays.asList(validModes).contains(mode)) { return param("mode", mode); } throw new IllegalArgumentException( @@ -127,10 +123,10 @@ public DistanceMatrixApiRequest avoid(RouteRestriction restriction) { * contain text within distance fields to indicate the distance of the calculated route. * * @param unit One of {@link Unit#METRIC} or {@link Unit#IMPERIAL}. + * @return Returns this {@code DistanceMatrixApiRequest} for call chaining. * @see * Unit systems in the Distance Matrix API - * @return Returns this {@code DistanceMatrixApiRequest} for call chaining. */ public DistanceMatrixApiRequest units(Unit unit) { return param("units", unit); diff --git a/src/main/java/com/google/maps/ElevationApi.java b/src/main/java/com/google/maps/ElevationApi.java index adad922c3..437e20800 100644 --- a/src/main/java/com/google/maps/ElevationApi.java +++ b/src/main/java/com/google/maps/ElevationApi.java @@ -110,6 +110,19 @@ public static PendingResult getByPoint(GeoApiContext context, L return context.get(API_CONFIG, SingularResponse.class, "locations", location.toString()); } + /** + * Retrieves the elevations of an encoded polyline path. + * + * @param context The {@link GeoApiContext} to make requests through. + * @param encodedPolyline The encoded polyline to retrieve elevations for. + * @return The elevations as a {@link PendingResult}. + */ + public static PendingResult getByPoints( + GeoApiContext context, EncodedPolyline encodedPolyline) { + return context.get( + API_CONFIG, MultiResponse.class, "locations", "enc:" + encodedPolyline.getEncodedPath()); + } + private static class SingularResponse implements ApiResponse { public String status; public String errorMessage; @@ -134,19 +147,6 @@ public ApiException getError() { } } - /** - * Retrieves the elevations of an encoded polyline path. - * - * @param context The {@link GeoApiContext} to make requests through. - * @param encodedPolyline The encoded polyline to retrieve elevations for. - * @return The elevations as a {@link PendingResult}. - */ - public static PendingResult getByPoints( - GeoApiContext context, EncodedPolyline encodedPolyline) { - return context.get( - API_CONFIG, MultiResponse.class, "locations", "enc:" + encodedPolyline.getEncodedPath()); - } - private static class MultiResponse implements ApiResponse { public String status; public String errorMessage; diff --git a/src/main/java/com/google/maps/FindPlaceFromTextRequest.java b/src/main/java/com/google/maps/FindPlaceFromTextRequest.java index 667738b18..faa6371b1 100644 --- a/src/main/java/com/google/maps/FindPlaceFromTextRequest.java +++ b/src/main/java/com/google/maps/FindPlaceFromTextRequest.java @@ -38,22 +38,6 @@ public FindPlaceFromTextRequest(GeoApiContext context) { super(context, API_CONFIG, Response.class); } - public enum InputType implements UrlValue { - TEXT_QUERY("textquery"), - PHONE_NUMBER("phonenumber"); - - private final String inputType; - - InputType(final String inputType) { - this.inputType = inputType; - } - - @Override - public String toUrlValue() { - return this.inputType; - } - } - /** * The text input specifying which place to search for (for example, a name, address, or phone * number). @@ -106,30 +90,19 @@ protected void validateRequest() { } } - public static class Response implements ApiResponse { - - public String status; - public PlacesSearchResult candidates[]; - public String errorMessage; + public enum InputType implements UrlValue { + TEXT_QUERY("textquery"), + PHONE_NUMBER("phonenumber"); - @Override - public boolean successful() { - return "OK".equals(status) || "ZERO_RESULTS".equals(status); - } + private final String inputType; - @Override - public FindPlaceFromText getResult() { - FindPlaceFromText result = new FindPlaceFromText(); - result.candidates = candidates; - return result; + InputType(final String inputType) { + this.inputType = inputType; } @Override - public ApiException getError() { - if (successful()) { - return null; - } - return ApiException.from(status, errorMessage); + public String toUrlValue() { + return this.inputType; } } @@ -163,6 +136,33 @@ public String toUrlValue() { public interface LocationBias extends UrlValue {} + public static class Response implements ApiResponse { + + public String status; + public PlacesSearchResult candidates[]; + public String errorMessage; + + @Override + public boolean successful() { + return "OK".equals(status) || "ZERO_RESULTS".equals(status); + } + + @Override + public FindPlaceFromText getResult() { + FindPlaceFromText result = new FindPlaceFromText(); + result.candidates = candidates; + return result; + } + + @Override + public ApiException getError() { + if (successful()) { + return null; + } + return ApiException.from(status, errorMessage); + } + } + public static class LocationBiasIP implements LocationBias { @Override public String toUrlValue() { diff --git a/src/main/java/com/google/maps/GaeRequestHandler.java b/src/main/java/com/google/maps/GaeRequestHandler.java index d42712647..ef7bee76b 100644 --- a/src/main/java/com/google/maps/GaeRequestHandler.java +++ b/src/main/java/com/google/maps/GaeRequestHandler.java @@ -17,12 +17,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; -import com.google.appengine.api.urlfetch.FetchOptions; -import com.google.appengine.api.urlfetch.HTTPHeader; -import com.google.appengine.api.urlfetch.HTTPMethod; -import com.google.appengine.api.urlfetch.HTTPRequest; -import com.google.appengine.api.urlfetch.URLFetchService; -import com.google.appengine.api.urlfetch.URLFetchServiceFactory; +import com.google.appengine.api.urlfetch.*; import com.google.gson.FieldNamingPolicy; import com.google.maps.GeoApiContext.RequestHandler; import com.google.maps.internal.ApiResponse; diff --git a/src/main/java/com/google/maps/GeoApiContext.java b/src/main/java/com/google/maps/GeoApiContext.java index 4d94fd65a..f7c39cb94 100644 --- a/src/main/java/com/google/maps/GeoApiContext.java +++ b/src/main/java/com/google/maps/GeoApiContext.java @@ -18,11 +18,7 @@ import com.google.gson.FieldNamingPolicy; import com.google.maps.errors.ApiException; import com.google.maps.errors.OverQueryLimitException; -import com.google.maps.internal.ApiConfig; -import com.google.maps.internal.ApiResponse; -import com.google.maps.internal.ExceptionsAllowedToRetry; -import com.google.maps.internal.HttpHeaders; -import com.google.maps.internal.UrlSigner; +import com.google.maps.internal.*; import com.google.maps.metrics.NoOpRequestMetricsReporter; import com.google.maps.metrics.RequestMetrics; import com.google.maps.metrics.RequestMetricsReporter; @@ -47,9 +43,9 @@ * *

GeoApiContexts should be shared

* - * GeoApiContext works best when you create a single GeoApiContext instance, or one per API key, and - * reuse it for all your Google Geo API queries. This is because each GeoApiContext manages its own - * thread pool, back-end client, and other resources. + *

GeoApiContext works best when you create a single GeoApiContext instance, or one per API key, + * and reuse it for all your Google Geo API queries. This is because each GeoApiContext manages its + * own thread pool, back-end client, and other resources. * *

When you are finished with a GeoApiContext object, you must call {@link #shutdown()} on it to * release its resources. @@ -107,60 +103,6 @@ public void close() throws IOException { shutdown(); } - /** - * The service provider interface that enables requests to be handled via switchable back ends. - * There are supplied implementations of this interface for both OkHttp and Google App Engine's - * URL Fetch API. - * - * @see OkHttpRequestHandler - * @see GaeRequestHandler - */ - public interface RequestHandler { - - > PendingResult handle( - String hostName, - String url, - Map headers, - Class clazz, - FieldNamingPolicy fieldNamingPolicy, - long errorTimeout, - Integer maxRetries, - ExceptionsAllowedToRetry exceptionsAllowedToRetry, - RequestMetrics metrics); - - > PendingResult handlePost( - String hostName, - String url, - String payload, - Map headers, - Class clazz, - FieldNamingPolicy fieldNamingPolicy, - long errorTimeout, - Integer maxRetries, - ExceptionsAllowedToRetry exceptionsAllowedToRetry, - RequestMetrics metrics); - - void shutdown(); - - /** Builder pattern for {@code GeoApiContext.RequestHandler}. */ - interface Builder { - - Builder connectTimeout(long timeout, TimeUnit unit); - - Builder readTimeout(long timeout, TimeUnit unit); - - Builder writeTimeout(long timeout, TimeUnit unit); - - Builder queriesPerSecond(int maxQps); - - Builder proxy(Proxy proxy); - - Builder proxyAuthentication(String proxyUserName, String proxyUserPassword); - - RequestHandler build(); - } - } - /** * Shut down this GeoApiContext instance, reclaiming resources. After shutdown() has been called, * no further queries may be done against this instance. @@ -369,6 +311,60 @@ private void checkContext(boolean canUseClientId) { } } + /** + * The service provider interface that enables requests to be handled via switchable back ends. + * There are supplied implementations of this interface for both OkHttp and Google App Engine's + * URL Fetch API. + * + * @see OkHttpRequestHandler + * @see GaeRequestHandler + */ + public interface RequestHandler { + + > PendingResult handle( + String hostName, + String url, + Map headers, + Class clazz, + FieldNamingPolicy fieldNamingPolicy, + long errorTimeout, + Integer maxRetries, + ExceptionsAllowedToRetry exceptionsAllowedToRetry, + RequestMetrics metrics); + + > PendingResult handlePost( + String hostName, + String url, + String payload, + Map headers, + Class clazz, + FieldNamingPolicy fieldNamingPolicy, + long errorTimeout, + Integer maxRetries, + ExceptionsAllowedToRetry exceptionsAllowedToRetry, + RequestMetrics metrics); + + void shutdown(); + + /** Builder pattern for {@code GeoApiContext.RequestHandler}. */ + interface Builder { + + Builder connectTimeout(long timeout, TimeUnit unit); + + Builder readTimeout(long timeout, TimeUnit unit); + + Builder writeTimeout(long timeout, TimeUnit unit); + + Builder queriesPerSecond(int maxQps); + + Builder proxy(Proxy proxy); + + Builder proxyAuthentication(String proxyUserName, String proxyUserPassword); + + RequestHandler build(); + } + } + /** The Builder for {@code GeoApiContext}. */ public static class Builder { @@ -424,9 +420,9 @@ public Builder baseUrlOverride(String baseUrl) { * Older name for {@link #baseUrlOverride(String)}. This was used back when testing was the only * use case foreseen for this. * - * @deprecated Use baseUrlOverride(String) instead. * @param baseUrl The URL to use, without a trailing slash, e.g. https://maps.googleapis.com * @return Returns this builder for call chaining. + * @deprecated Use baseUrlOverride(String) instead. */ @Deprecated Builder baseUrlForTesting(String baseUrl) { @@ -477,10 +473,10 @@ public Builder channel(String channel) { /** * Sets the default connect timeout for new connections. A value of 0 means no timeout. * - * @see java.net.URLConnection#setConnectTimeout(int) * @param timeout The connect timeout period in {@code unit}s. * @param unit The connect timeout time unit. * @return Returns this builder for call chaining. + * @see java.net.URLConnection#setConnectTimeout(int) */ public Builder connectTimeout(long timeout, TimeUnit unit) { builder.connectTimeout(timeout, unit); @@ -490,10 +486,10 @@ public Builder connectTimeout(long timeout, TimeUnit unit) { /** * Sets the default read timeout for new connections. A value of 0 means no timeout. * - * @see java.net.URLConnection#setReadTimeout(int) * @param timeout The read timeout period in {@code unit}s. * @param unit The read timeout time unit. * @return Returns this builder for call chaining. + * @see java.net.URLConnection#setReadTimeout(int) */ public Builder readTimeout(long timeout, TimeUnit unit) { builder.readTimeout(timeout, unit); diff --git a/src/main/java/com/google/maps/GeocodingApiRequest.java b/src/main/java/com/google/maps/GeocodingApiRequest.java index 4a4d251ef..ecfd2b43a 100644 --- a/src/main/java/com/google/maps/GeocodingApiRequest.java +++ b/src/main/java/com/google/maps/GeocodingApiRequest.java @@ -18,11 +18,7 @@ import static com.google.maps.internal.StringJoin.join; import com.google.maps.internal.ApiConfig; -import com.google.maps.model.AddressType; -import com.google.maps.model.ComponentFilter; -import com.google.maps.model.GeocodingResult; -import com.google.maps.model.LatLng; -import com.google.maps.model.LocationType; +import com.google.maps.model.*; /** A request for the Geocoding API. */ public class GeocodingApiRequest @@ -37,21 +33,33 @@ public GeocodingApiRequest(GeoApiContext context) { @Override protected void validateRequest() { // Must not have both address and latlng. - if (params().containsKey("latlng") - && params().containsKey("address") - && params().containsKey("place_id")) { - throw new IllegalArgumentException( - "Request must contain only one of 'address', 'latlng' or 'place_id'."); - } + validateRequestHasOnlyOne("address", "latlng", "place_id"); // Must contain at least one of place_id, address, latlng, and components; - if (!params().containsKey("latlng") - && !params().containsKey("address") - && !params().containsKey("components") - && !params().containsKey("place_id")) { - throw new IllegalArgumentException( - "Request must contain at least one of 'address', 'latlng', 'place_id' and 'components'."); + validateRequestHasAtLeastOne("address", "latlng", "place_id", "components"); + } + + private void validateRequestHasOnlyOne(String... keys) { + for (String key : keys) { + if (params().containsKey(key)) { + for (String otherKey : keys) { + if (!key.equals(otherKey) && params().containsKey(otherKey)) { + throw new IllegalArgumentException( + "Request must not contain both '" + key + "' and '" + otherKey + "'."); + } + } + } + } + } + + private void validateRequestHasAtLeastOne(String... keys) { + for (String key : keys) { + if (params().containsKey(key)) { + return; + } } + throw new IllegalArgumentException( + "Request must contain at least one of '" + join("', '", keys) + "'."); } /** @@ -64,6 +72,17 @@ public GeocodingApiRequest address(String address) { return param("address", address); } + /** + * Custom parameter. For advanced usage only. + * + * @param parameter The name of the custom parameter. + * @param value The value of the custom parameter. + * @return Returns the request for call chaining. + */ + public GeocodingApiRequest custom(String parameter, String value) { + return param(parameter, value); + } + /** * Creates a forward geocode for {@code placeId}. * @@ -115,21 +134,6 @@ public GeocodingApiRequest region(String region) { return param("region", region); } - /** - * Sets the component filters. Each component filter consists of a component:value pair and will - * fully restrict the results from the geocoder. - * - *

For more information see - * Component Filtering. - * - * @param filters Component filters to apply to the request. - * @return Returns this {@code GeocodingApiRequest} for call chaining. - */ - public GeocodingApiRequest components(ComponentFilter... filters) { - return param("components", join('|', filters)); - } - /** * Sets the result type. Specifying a type will restrict the results to this type. If multiple * types are specified, the API will return all addresses that match any of the types. diff --git a/src/main/java/com/google/maps/ImageResult.java b/src/main/java/com/google/maps/ImageResult.java index 8083760b5..3d944f9aa 100644 --- a/src/main/java/com/google/maps/ImageResult.java +++ b/src/main/java/com/google/maps/ImageResult.java @@ -22,11 +22,6 @@ /** {@code ImageResult} is the object returned from API end points that return images. */ public class ImageResult implements Serializable { - public ImageResult(String contentType, byte[] imageData) { - this.imageData = imageData; - this.contentType = contentType; - } - private static final long serialVersionUID = 1L; /** The image data from the Photos API call. */ @@ -35,6 +30,11 @@ public ImageResult(String contentType, byte[] imageData) { /** The Content-Type header of the returned result. */ public final String contentType; + public ImageResult(String contentType, byte[] imageData) { + this.imageData = imageData; + this.contentType = contentType; + } + /** * ImageResult.Response is a type system hack to enable API endpoints to return a * ImageResult. diff --git a/src/main/java/com/google/maps/NearbySearchRequest.java b/src/main/java/com/google/maps/NearbySearchRequest.java index 406d060f9..8d35e4857 100644 --- a/src/main/java/com/google/maps/NearbySearchRequest.java +++ b/src/main/java/com/google/maps/NearbySearchRequest.java @@ -21,12 +21,7 @@ import com.google.maps.errors.ApiException; import com.google.maps.internal.ApiConfig; import com.google.maps.internal.ApiResponse; -import com.google.maps.model.LatLng; -import com.google.maps.model.PlaceType; -import com.google.maps.model.PlacesSearchResponse; -import com.google.maps.model.PlacesSearchResult; -import com.google.maps.model.PriceLevel; -import com.google.maps.model.RankBy; +import com.google.maps.model.*; /** * A Nearby @@ -162,9 +157,9 @@ public NearbySearchRequest type(PlaceType type) { * Restricts the results to places matching the specified type. Provides support for multiple * types. * - * @deprecated Multiple search types are ignored by the Places API. * @param types The {@link PlaceType}s to restrict results to. * @return Returns this {@code NearbyApiRequest} for call chaining. + * @deprecated Multiple search types are ignored by the Places API. */ @Deprecated public NearbySearchRequest type(PlaceType... types) { diff --git a/src/main/java/com/google/maps/OkHttpRequestHandler.java b/src/main/java/com/google/maps/OkHttpRequestHandler.java index 64b29f123..4b9115a6a 100644 --- a/src/main/java/com/google/maps/OkHttpRequestHandler.java +++ b/src/main/java/com/google/maps/OkHttpRequestHandler.java @@ -30,12 +30,7 @@ import java.util.Map.Entry; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; -import okhttp3.Credentials; -import okhttp3.Dispatcher; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; +import okhttp3.*; /** * A strategy for handling URL requests using OkHttp. diff --git a/src/main/java/com/google/maps/PendingResultBase.java b/src/main/java/com/google/maps/PendingResultBase.java index 6c1aa560c..bff5daf15 100644 --- a/src/main/java/com/google/maps/PendingResultBase.java +++ b/src/main/java/com/google/maps/PendingResultBase.java @@ -22,11 +22,7 @@ import com.google.maps.internal.StringJoin; import com.google.maps.internal.StringJoin.UrlValue; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * Base implementation for {@code PendingResult}. @@ -169,9 +165,9 @@ protected Map> params() { * list may not be exhaustive. * * @param language The language code, e.g. "en-AU" or "es". + * @return Returns the request for call chaining. * @see List of supported domain * languages - * @return Returns the request for call chaining. */ public final A language(String language) { return param("language", language); diff --git a/src/main/java/com/google/maps/PlaceAutocompleteRequest.java b/src/main/java/com/google/maps/PlaceAutocompleteRequest.java index 077c3c79c..94155912f 100644 --- a/src/main/java/com/google/maps/PlaceAutocompleteRequest.java +++ b/src/main/java/com/google/maps/PlaceAutocompleteRequest.java @@ -46,52 +46,6 @@ protected PlaceAutocompleteRequest(GeoApiContext context) { super(context, API_CONFIG, Response.class); } - /** SessionToken represents an Autocomplete session. */ - public static final class SessionToken implements UrlValue, Serializable { - - private static final long serialVersionUID = 1L; - - private UUID uuid; - - /** This constructor creates a new session. */ - public SessionToken() { - uuid = UUID.randomUUID(); - } - - /** - * Construct a session that is a continuation of a previous session. - * - * @param uuid The universally unique identifier for this session. - */ - public SessionToken(UUID uuid) { - this.uuid = uuid; - } - - /** - * Construct a session that is a continuation of a previous session. - * - * @param token The unique String to be used as the seed for the session identifier. - */ - public SessionToken(String token) { - this.uuid = UUID.nameUUIDFromBytes(token.getBytes()); - } - - /** - * Retrieve the universally unique identifier for this session. This enables you to recreate the - * session token in a later context. - * - * @return Returns the universally unique identifier for this session. - */ - public UUID getUUID() { - return uuid; - } - - @Override - public String toUrlValue() { - return uuid.toString(); - } - } - /** * Sets the SessionToken for this request. Using session token makes sure the autocomplete is * priced per session, instead of per keystroke. @@ -211,6 +165,52 @@ protected void validateRequest() { } } + /** SessionToken represents an Autocomplete session. */ + public static final class SessionToken implements UrlValue, Serializable { + + private static final long serialVersionUID = 1L; + + private UUID uuid; + + /** This constructor creates a new session. */ + public SessionToken() { + uuid = UUID.randomUUID(); + } + + /** + * Construct a session that is a continuation of a previous session. + * + * @param uuid The universally unique identifier for this session. + */ + public SessionToken(UUID uuid) { + this.uuid = uuid; + } + + /** + * Construct a session that is a continuation of a previous session. + * + * @param token The unique String to be used as the seed for the session identifier. + */ + public SessionToken(String token) { + this.uuid = UUID.nameUUIDFromBytes(token.getBytes()); + } + + /** + * Retrieve the universally unique identifier for this session. This enables you to recreate the + * session token in a later context. + * + * @return Returns the universally unique identifier for this session. + */ + public UUID getUUID() { + return uuid; + } + + @Override + public String toUrlValue() { + return uuid.toString(); + } + } + public static class Response implements ApiResponse { public String status; public AutocompletePrediction predictions[]; diff --git a/src/main/java/com/google/maps/PlaceDetailsRequest.java b/src/main/java/com/google/maps/PlaceDetailsRequest.java index 7e2a4b1cf..a6377e2c0 100644 --- a/src/main/java/com/google/maps/PlaceDetailsRequest.java +++ b/src/main/java/com/google/maps/PlaceDetailsRequest.java @@ -111,34 +111,6 @@ protected void validateRequest() { } } - public static class Response implements ApiResponse { - public String status; - public PlaceDetails result; - public String[] htmlAttributions; - public String errorMessage; - - @Override - public boolean successful() { - return "OK".equals(status) || "ZERO_RESULTS".equals(status); - } - - @Override - public PlaceDetails getResult() { - if (result != null) { - result.htmlAttributions = htmlAttributions; - } - return result; - } - - @Override - public ApiException getError() { - if (successful()) { - return null; - } - return ApiException.from(status, errorMessage); - } - } - public enum FieldMask implements UrlValue { ADDRESS_COMPONENT("address_component"), ADR_ADDRESS("adr_address"), @@ -212,4 +184,32 @@ public String toUrlValue() { return field; } } + + public static class Response implements ApiResponse { + public String status; + public PlaceDetails result; + public String[] htmlAttributions; + public String errorMessage; + + @Override + public boolean successful() { + return "OK".equals(status) || "ZERO_RESULTS".equals(status); + } + + @Override + public PlaceDetails getResult() { + if (result != null) { + result.htmlAttributions = htmlAttributions; + } + return result; + } + + @Override + public ApiException getError() { + if (successful()) { + return null; + } + return ApiException.from(status, errorMessage); + } + } } diff --git a/src/main/java/com/google/maps/StaticMapsRequest.java b/src/main/java/com/google/maps/StaticMapsRequest.java index 327a84780..41e7ad1ec 100644 --- a/src/main/java/com/google/maps/StaticMapsRequest.java +++ b/src/main/java/com/google/maps/StaticMapsRequest.java @@ -102,26 +102,6 @@ public StaticMapsRequest scale(int scale) { return param("scale", scale); } - public enum ImageFormat implements UrlValue { - png("png"), - png8("png8"), - png32("png32"), - gif("gif"), - jpg("jpg"), - jpgBaseline("jpg-baseline"); - - private final String format; - - ImageFormat(String format) { - this.format = format; - } - - @Override - public String toUrlValue() { - return format; - } - } - /** * format defines the format of the resulting image. By default, the Google Static * Maps API creates PNG images. There are several possible formats including GIF, JPEG and PNG @@ -134,18 +114,6 @@ public StaticMapsRequest format(ImageFormat format) { return param("format", format); } - public enum StaticMapType implements UrlValue { - roadmap, - satellite, - terrain, - hybrid; - - @Override - public String toUrlValue() { - return this.name(); - } - } - /** * maptype defines the type of map to construct. * @@ -168,44 +136,105 @@ public StaticMapsRequest region(String region) { return param("region", region); } - public static class Markers implements UrlValue { + /** + * markers parameter defines a set of one or more markers (map pins) at a set of + * locations. Each marker defined within a single markers declaration must exhibit the same visual + * style; if you wish to display markers with different styles, you will need to supply multiple + * markers parameters with separate style information. + * + * @param markers A group of markers with the same style. + * @return Returns this {@code StaticMapsRequest} for call chaining. + */ + public StaticMapsRequest markers(Markers markers) { + return paramAddToList("markers", markers); + } - public enum MarkersSize implements UrlValue { - tiny, - mid, - small, - normal; + /** + * The path parameter defines a set of one or more locations connected by a path to + * overlay on the map image. + * + * @param path A path to render atop the map. + * @return Returns this {@code StaticMapsRequest} for call chaining. + */ + public StaticMapsRequest path(Path path) { + return paramAddToList("path", path); + } - @Override - public String toUrlValue() { - return this.name(); - } + /** + * The path parameter defines a set of one or more locations connected by a path to + * overlay on the map image. This variant of the method accepts the path as an EncodedPolyline. + * + * @param path A path to render atop the map, as an EncodedPolyline. + * @return Returns this {@code StaticMapsRequest} for call chaining. + */ + public StaticMapsRequest path(EncodedPolyline path) { + return paramAddToList("path", "enc:" + path.getEncodedPath()); + } + + /** + * visible instructs the Google Static Maps API service to construct a map such that + * the existing locations remain visible. + * + * @param visibleLocation The location to be made visible in the requested Static Map. + * @return Returns this {@code StaticMapsRequest} for call chaining. + */ + public StaticMapsRequest visible(LatLng visibleLocation) { + return param("visible", visibleLocation); + } + + /** + * visible instructs the Google Static Maps API service to construct a map such that + * the existing locations remain visible. + * + * @param visibleLocation The location to be made visible in the requested Static Map. + * @return Returns this {@code StaticMapsRequest} for call chaining. + */ + public StaticMapsRequest visible(String visibleLocation) { + return param("visible", visibleLocation); + } + + public enum ImageFormat implements UrlValue { + png("png"), + png8("png8"), + png32("png32"), + gif("gif"), + jpg("jpg"), + jpgBaseline("jpg-baseline"); + + private final String format; + + ImageFormat(String format) { + this.format = format; } - public enum CustomIconAnchor implements UrlValue { - top, - bottom, - left, - right, - center, - topleft, - topright, - bottomleft, - bottomright; + @Override + public String toUrlValue() { + return format; + } + } - @Override - public String toUrlValue() { - return this.name(); - } + public enum StaticMapType implements UrlValue { + roadmap, + satellite, + terrain, + hybrid; + + @Override + public String toUrlValue() { + return this.name(); } + } + public static class Markers implements UrlValue { + + private static final Pattern labelPattern = Pattern.compile("^[A-Z0-9]$"); + private final List locations = new ArrayList<>(); private MarkersSize size; private String color; private String label; private String customIconURL; private CustomIconAnchor anchorPoint; private Integer scale; - private final List locations = new ArrayList<>(); /** * Specifies the size of marker. If no size parameter is set, the marker will appear in its @@ -227,8 +256,6 @@ public void color(String color) { this.color = color; } - private static final Pattern labelPattern = Pattern.compile("^[A-Z0-9]$"); - /** * Specifies a single uppercase alphanumeric character from the set {A-Z, 0-9}. * @@ -317,28 +344,44 @@ public String toUrlValue() { return StringJoin.join('|', urlParts.toArray(new String[urlParts.size()])); } - } - /** - * markers parameter defines a set of one or more markers (map pins) at a set of - * locations. Each marker defined within a single markers declaration must exhibit the same visual - * style; if you wish to display markers with different styles, you will need to supply multiple - * markers parameters with separate style information. - * - * @param markers A group of markers with the same style. - * @return Returns this {@code StaticMapsRequest} for call chaining. - */ - public StaticMapsRequest markers(Markers markers) { - return paramAddToList("markers", markers); + public enum MarkersSize implements UrlValue { + tiny, + mid, + small, + normal; + + @Override + public String toUrlValue() { + return this.name(); + } + } + + public enum CustomIconAnchor implements UrlValue { + top, + bottom, + left, + right, + center, + topleft, + topright, + bottomleft, + bottomright; + + @Override + public String toUrlValue() { + return this.name(); + } + } } public static class Path implements UrlValue { + private final List points = new ArrayList<>(); private int weight; private String color; private String fillcolor; private boolean geodesic; - private final List points = new ArrayList<>(); /** * Specifies the thickness of the path in pixels. If no weight parameter is set, the path will @@ -423,48 +466,4 @@ public String toUrlValue() { return StringJoin.join('|', urlParts.toArray(new String[urlParts.size()])); } } - - /** - * The path parameter defines a set of one or more locations connected by a path to - * overlay on the map image. - * - * @param path A path to render atop the map. - * @return Returns this {@code StaticMapsRequest} for call chaining. - */ - public StaticMapsRequest path(Path path) { - return paramAddToList("path", path); - } - - /** - * The path parameter defines a set of one or more locations connected by a path to - * overlay on the map image. This variant of the method accepts the path as an EncodedPolyline. - * - * @param path A path to render atop the map, as an EncodedPolyline. - * @return Returns this {@code StaticMapsRequest} for call chaining. - */ - public StaticMapsRequest path(EncodedPolyline path) { - return paramAddToList("path", "enc:" + path.getEncodedPath()); - } - - /** - * visible instructs the Google Static Maps API service to construct a map such that - * the existing locations remain visible. - * - * @param visibleLocation The location to be made visible in the requested Static Map. - * @return Returns this {@code StaticMapsRequest} for call chaining. - */ - public StaticMapsRequest visible(LatLng visibleLocation) { - return param("visible", visibleLocation); - } - - /** - * visible instructs the Google Static Maps API service to construct a map such that - * the existing locations remain visible. - * - * @param visibleLocation The location to be made visible in the requested Static Map. - * @return Returns this {@code StaticMapsRequest} for call chaining. - */ - public StaticMapsRequest visible(String visibleLocation) { - return param("visible", visibleLocation); - } } diff --git a/src/main/java/com/google/maps/TextSearchRequest.java b/src/main/java/com/google/maps/TextSearchRequest.java index 0f73f6d5b..52e7fa6df 100644 --- a/src/main/java/com/google/maps/TextSearchRequest.java +++ b/src/main/java/com/google/maps/TextSearchRequest.java @@ -19,12 +19,7 @@ import com.google.maps.errors.ApiException; import com.google.maps.internal.ApiConfig; import com.google.maps.internal.ApiResponse; -import com.google.maps.model.LatLng; -import com.google.maps.model.PlaceType; -import com.google.maps.model.PlacesSearchResponse; -import com.google.maps.model.PlacesSearchResult; -import com.google.maps.model.PriceLevel; -import com.google.maps.model.RankBy; +import com.google.maps.model.*; /** * A Text diff --git a/src/main/java/com/google/maps/android/AndroidAuthenticationConfigProvider.java b/src/main/java/com/google/maps/android/AndroidAuthenticationConfigProvider.java index 861fad33c..86b724798 100644 --- a/src/main/java/com/google/maps/android/AndroidAuthenticationConfigProvider.java +++ b/src/main/java/com/google/maps/android/AndroidAuthenticationConfigProvider.java @@ -6,7 +6,9 @@ */ public class AndroidAuthenticationConfigProvider { - /** @return the environment specific {@link AndroidAuthenticationConfig} */ + /** + * @return the environment specific {@link AndroidAuthenticationConfig} + */ public AndroidAuthenticationConfig provide() { Context context = Context.getApplicationContext(); if (context == null) { diff --git a/src/main/java/com/google/maps/android/Context.java b/src/main/java/com/google/maps/android/Context.java index d23981a1f..6bae427f4 100644 --- a/src/main/java/com/google/maps/android/Context.java +++ b/src/main/java/com/google/maps/android/Context.java @@ -32,7 +32,9 @@ public static Context getApplicationContext() { } } - /** @return the package name of the Android app if available, otherwise, null */ + /** + * @return the package name of the Android app if available, otherwise, null + */ @Nullable public String getPackageName() { try { diff --git a/src/main/java/com/google/maps/android/PackageInfo.java b/src/main/java/com/google/maps/android/PackageInfo.java index 4ca9467c6..ab66dc14c 100644 --- a/src/main/java/com/google/maps/android/PackageInfo.java +++ b/src/main/java/com/google/maps/android/PackageInfo.java @@ -13,7 +13,9 @@ public PackageInfo(Class piClass, Object piInstance) { this.piInstance = piInstance; } - /** @return the signing signature for the app */ + /** + * @return the signing signature for the app + */ @Nullable public Object signingSignature() { try { diff --git a/src/main/java/com/google/maps/internal/GaePendingResult.java b/src/main/java/com/google/maps/internal/GaePendingResult.java index 9f6b2a13d..17244e4e6 100644 --- a/src/main/java/com/google/maps/internal/GaePendingResult.java +++ b/src/main/java/com/google/maps/internal/GaePendingResult.java @@ -29,19 +29,9 @@ import com.google.maps.errors.ApiException; import com.google.maps.errors.UnknownErrorException; import com.google.maps.metrics.RequestMetrics; -import com.google.maps.model.AddressComponentType; -import com.google.maps.model.AddressType; -import com.google.maps.model.Distance; -import com.google.maps.model.Duration; -import com.google.maps.model.EncodedPolyline; -import com.google.maps.model.Fare; -import com.google.maps.model.LatLng; -import com.google.maps.model.LocationType; +import com.google.maps.model.*; import com.google.maps.model.OpeningHours.Period.OpenClose.DayOfWeek; import com.google.maps.model.PlaceDetails.Review.AspectRating.RatingType; -import com.google.maps.model.PriceLevel; -import com.google.maps.model.TravelMode; -import com.google.maps.model.VehicleType; import java.io.IOException; import java.nio.charset.Charset; import java.time.Instant; @@ -62,6 +52,8 @@ * request. */ public class GaePendingResult> implements PendingResult { + private static final Logger LOG = LoggerFactory.getLogger(GaePendingResult.class.getName()); + private static final List RETRY_ERROR_CODES = Arrays.asList(500, 503, 504); private final HTTPRequest request; private final URLFetchService client; private final Class responseClass; @@ -69,15 +61,11 @@ public class GaePendingResult> implements PendingRes private final Integer maxRetries; private final ExceptionsAllowedToRetry exceptionsAllowedToRetry; private final RequestMetrics metrics; - private long errorTimeOut; private int retryCounter = 0; private long cumulativeSleepTime = 0; private Future call; - private static final Logger LOG = LoggerFactory.getLogger(GaePendingResult.class.getName()); - private static final List RETRY_ERROR_CODES = Arrays.asList(500, 503, 504); - /** * @param request HTTP request to execute. * @param client The client used to execute the request. diff --git a/src/main/java/com/google/maps/internal/GeolocationResponseAdapter.java b/src/main/java/com/google/maps/internal/GeolocationResponseAdapter.java index 5102a4c0d..574eee435 100644 --- a/src/main/java/com/google/maps/internal/GeolocationResponseAdapter.java +++ b/src/main/java/com/google/maps/internal/GeolocationResponseAdapter.java @@ -39,7 +39,8 @@ public class GeolocationResponseAdapter extends TypeAdapter * - * Error Case: The response contains an object with a single error object with the following keys: + *

Error Case: The response contains an object with a single error object with the following + * keys: * *

code: This is the same as the HTTP status of the response. {@code message}: A short * description of the error. {@code errors}: A list of errors which occurred. Each error contains diff --git a/src/main/java/com/google/maps/internal/OkHttpPendingResult.java b/src/main/java/com/google/maps/internal/OkHttpPendingResult.java index 2f68ef54f..8c4519561 100644 --- a/src/main/java/com/google/maps/internal/OkHttpPendingResult.java +++ b/src/main/java/com/google/maps/internal/OkHttpPendingResult.java @@ -24,18 +24,9 @@ import com.google.maps.PendingResult; import com.google.maps.errors.ApiException; import com.google.maps.metrics.RequestMetrics; -import com.google.maps.model.AddressComponentType; -import com.google.maps.model.AddressType; -import com.google.maps.model.Distance; -import com.google.maps.model.Duration; -import com.google.maps.model.Fare; -import com.google.maps.model.LatLng; -import com.google.maps.model.LocationType; +import com.google.maps.model.*; import com.google.maps.model.OpeningHours.Period.OpenClose.DayOfWeek; import com.google.maps.model.PlaceDetails.Review.AspectRating.RatingType; -import com.google.maps.model.PriceLevel; -import com.google.maps.model.TravelMode; -import com.google.maps.model.VehicleType; import java.io.IOException; import java.time.Instant; import java.time.LocalTime; @@ -44,12 +35,7 @@ import java.util.List; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; +import okhttp3.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -62,13 +48,14 @@ */ public class OkHttpPendingResult> implements PendingResult, Callback { + private static final Logger LOG = LoggerFactory.getLogger(OkHttpPendingResult.class.getName()); + private static final List RETRY_ERROR_CODES = Arrays.asList(500, 503, 504); private final Request request; private final OkHttpClient client; private final Class responseClass; private final FieldNamingPolicy fieldNamingPolicy; private final Integer maxRetries; private final RequestMetrics metrics; - private Call call; private Callback callback; private long errorTimeOut; @@ -76,9 +63,6 @@ public class OkHttpPendingResult> private long cumulativeSleepTime = 0; private ExceptionsAllowedToRetry exceptionsAllowedToRetry; - private static final Logger LOG = LoggerFactory.getLogger(OkHttpPendingResult.class.getName()); - private static final List RETRY_ERROR_CODES = Arrays.asList(500, 503, 504); - /** * @param request HTTP request to execute. * @param client The client used to execute the request. @@ -116,25 +100,6 @@ public void setCallback(Callback callback) { call.enqueue(this); } - /** Preserve a request/response pair through an asynchronous callback. */ - private class QueuedResponse { - private final OkHttpPendingResult request; - private final Response response; - private final IOException e; - - public QueuedResponse(OkHttpPendingResult request, Response response) { - this.request = request; - this.response = response; - this.e = null; - } - - public QueuedResponse(OkHttpPendingResult request, IOException e) { - this.request = request; - this.response = null; - this.e = e; - } - } - @Override public T await() throws ApiException, IOException, InterruptedException { // Handle sleeping for retried requests @@ -341,4 +306,23 @@ private boolean shouldRetry(ApiException exception) { && cumulativeSleepTime < errorTimeOut && (maxRetries == null || retryCounter < maxRetries); } + + /** Preserve a request/response pair through an asynchronous callback. */ + private class QueuedResponse { + private final OkHttpPendingResult request; + private final Response response; + private final IOException e; + + public QueuedResponse(OkHttpPendingResult request, Response response) { + this.request = request; + this.response = response; + this.e = null; + } + + public QueuedResponse(OkHttpPendingResult request, IOException e) { + this.request = request; + this.response = null; + this.e = e; + } + } } diff --git a/src/main/java/com/google/maps/internal/RateLimitExecutorService.java b/src/main/java/com/google/maps/internal/RateLimitExecutorService.java index 1c94b0b33..6aef1b87a 100644 --- a/src/main/java/com/google/maps/internal/RateLimitExecutorService.java +++ b/src/main/java/com/google/maps/internal/RateLimitExecutorService.java @@ -18,17 +18,7 @@ import com.google.maps.internal.ratelimiter.RateLimiter; import java.util.Collection; import java.util.List; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; +import java.util.concurrent.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +28,7 @@ public class RateLimitExecutorService implements ExecutorService, Runnable { private static final Logger LOG = LoggerFactory.getLogger(RateLimitExecutorService.class.getName()); private static final int DEFAULT_QUERIES_PER_SECOND = 50; - + final Thread delayThread; // It's important we set Ok's second arg to threadFactory(.., true) to ensure the threads are // killed when the app exits. For synchronous requests this is ideal but it means any async // requests still pending after termination will be killed. @@ -50,13 +40,10 @@ public class RateLimitExecutorService implements ExecutorService, Runnable { TimeUnit.SECONDS, new SynchronousQueue(), threadFactory("Rate Limited Dispatcher", true)); - private final BlockingQueue queue = new LinkedBlockingQueue<>(); private final RateLimiter rateLimiter = RateLimiter.create(DEFAULT_QUERIES_PER_SECOND, 1, TimeUnit.SECONDS); - final Thread delayThread; - public RateLimitExecutorService() { setQueriesPerSecond(DEFAULT_QUERIES_PER_SECOND); delayThread = new Thread(this); @@ -65,6 +52,17 @@ public RateLimitExecutorService() { delayThread.start(); } + private static ThreadFactory threadFactory(final String name, final boolean daemon) { + return new ThreadFactory() { + @Override + public Thread newThread(Runnable runnable) { + Thread result = new Thread(runnable, name); + result.setDaemon(daemon); + return result; + } + }; + } + public void setQueriesPerSecond(int maxQps) { this.rateLimiter.setRate(maxQps); } @@ -85,17 +83,6 @@ public void run() { } } - private static ThreadFactory threadFactory(final String name, final boolean daemon) { - return new ThreadFactory() { - @Override - public Thread newThread(Runnable runnable) { - Thread result = new Thread(runnable, name); - result.setDaemon(daemon); - return result; - } - }; - } - @Override public void execute(Runnable runnable) { queue.add(runnable); diff --git a/src/main/java/com/google/maps/internal/SafeEnumAdapter.java b/src/main/java/com/google/maps/internal/SafeEnumAdapter.java index 19ab6848c..856abad76 100644 --- a/src/main/java/com/google/maps/internal/SafeEnumAdapter.java +++ b/src/main/java/com/google/maps/internal/SafeEnumAdapter.java @@ -38,7 +38,9 @@ public class SafeEnumAdapter> extends TypeAdapter { private final Class clazz; private final E unknownValue; - /** @param unknownValue the value to return if the value cannot be found. */ + /** + * @param unknownValue the value to return if the value cannot be found. + */ public SafeEnumAdapter(E unknownValue) { if (unknownValue == null) throw new IllegalArgumentException(); diff --git a/src/main/java/com/google/maps/internal/StringJoin.java b/src/main/java/com/google/maps/internal/StringJoin.java index 9af4e0b10..84067783d 100644 --- a/src/main/java/com/google/maps/internal/StringJoin.java +++ b/src/main/java/com/google/maps/internal/StringJoin.java @@ -20,15 +20,6 @@ /** Utility class to join strings. */ public class StringJoin { - /** - * Marker Interface to enable the URL Value enums in {@link com.google.maps.DirectionsApi} to be - * string joinable. - */ - public interface UrlValue { - /** @return the object, represented as a URL value (not URL encoded). */ - String toUrlValue(); - } - private StringJoin() {} public static String join(char delim, String... parts) { @@ -70,4 +61,15 @@ public static String join(char delim, UrlValue... parts) { return join(delim, strings); } + + /** + * Marker Interface to enable the URL Value enums in {@link com.google.maps.DirectionsApi} to be + * string joinable. + */ + public interface UrlValue { + /** + * @return the object, represented as a URL value (not URL encoded). + */ + String toUrlValue(); + } } diff --git a/src/main/java/com/google/maps/internal/ratelimiter/RateLimiter.java b/src/main/java/com/google/maps/internal/ratelimiter/RateLimiter.java index 7db4840f8..04826c4fb 100644 --- a/src/main/java/com/google/maps/internal/ratelimiter/RateLimiter.java +++ b/src/main/java/com/google/maps/internal/ratelimiter/RateLimiter.java @@ -31,9 +31,7 @@ import static com.google.maps.internal.ratelimiter.Preconditions.checkArgument; import static com.google.maps.internal.ratelimiter.Preconditions.checkNotNull; import static java.lang.Math.max; -import static java.util.concurrent.TimeUnit.MICROSECONDS; -import static java.util.concurrent.TimeUnit.NANOSECONDS; -import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.concurrent.TimeUnit.*; import com.google.maps.internal.ratelimiter.SmoothRateLimiter.SmoothBursty; import com.google.maps.internal.ratelimiter.SmoothRateLimiter.SmoothWarmingUp; @@ -97,6 +95,19 @@ * @since 13.0 */ public abstract class RateLimiter { + /** + * The underlying timer; used both to measure elapsed time and sleep as necessary. A separate + * object to facilitate testing. + */ + private final SleepingStopwatch stopwatch; + + // Can't be initialized in the constructor because mocks don't call the constructor. + private volatile Object mutexDoNotUseDirectly; + + RateLimiter(SleepingStopwatch stopwatch) { + this.stopwatch = checkNotNull(stopwatch); + } + /** * Creates a {@code RateLimiter} with the specified stable throughput, given as "permits per * second" (commonly referred to as QPS, queries per second). @@ -176,14 +187,32 @@ static RateLimiter create( return rateLimiter; } - /** - * The underlying timer; used both to measure elapsed time and sleep as necessary. A separate - * object to facilitate testing. - */ - private final SleepingStopwatch stopwatch; + private static void checkPermits(int permits) { + checkArgument(permits > 0, "Requested permits (%s) must be positive", permits); + } - // Can't be initialized in the constructor because mocks don't call the constructor. - private volatile Object mutexDoNotUseDirectly; + /** Invokes {@code unit.}{@link TimeUnit#sleep(long) sleep(sleepFor)} uninterruptibly. */ + private static void sleepUninterruptibly(long sleepFor, TimeUnit unit) { + boolean interrupted = false; + try { + long remainingNanos = unit.toNanos(sleepFor); + long end = System.nanoTime() + remainingNanos; + while (true) { + try { + // TimeUnit.sleep() treats negative timeouts just like zero. + NANOSECONDS.sleep(remainingNanos); + return; + } catch (InterruptedException e) { + interrupted = true; + remainingNanos = end - System.nanoTime(); + } + } + } finally { + if (interrupted) { + Thread.currentThread().interrupt(); + } + } + } private Object mutex() { Object mutex = mutexDoNotUseDirectly; @@ -198,8 +227,18 @@ private Object mutex() { return mutex; } - RateLimiter(SleepingStopwatch stopwatch) { - this.stopwatch = checkNotNull(stopwatch); + abstract void doSetRate(double permitsPerSecond, long nowMicros); + + /** + * Returns the stable rate (as {@code permits per seconds}) with which this {@code RateLimiter} is + * configured with. The initial value of this is the same as the {@code permitsPerSecond} argument + * passed in the factory method that produced this {@code RateLimiter}, and it is only updated + * after invocations to {@linkplain #setRate}. + */ + public final double getRate() { + synchronized (mutex()) { + return doGetRate(); + } } /** @@ -228,20 +267,6 @@ public final void setRate(double permitsPerSecond) { } } - abstract void doSetRate(double permitsPerSecond, long nowMicros); - - /** - * Returns the stable rate (as {@code permits per seconds}) with which this {@code RateLimiter} is - * configured with. The initial value of this is the same as the {@code permitsPerSecond} argument - * passed in the factory method that produced this {@code RateLimiter}, and it is only updated - * after invocations to {@linkplain #setRate}. - */ - public final double getRate() { - synchronized (mutex()) { - return doGetRate(); - } - } - abstract double doGetRate(); /** @@ -395,13 +420,6 @@ abstract static class SleepingStopwatch { /** Constructor for use by subclasses. */ protected SleepingStopwatch() {} - /* - * We always hold the mutex when calling this. - */ - protected abstract long readMicros(); - - protected abstract void sleepMicrosUninterruptibly(long micros); - public static SleepingStopwatch createFromSystemTimer() { return new SleepingStopwatch() { final Stopwatch stopwatch = Stopwatch.createStarted(); @@ -419,32 +437,12 @@ protected void sleepMicrosUninterruptibly(long micros) { } }; } - } - private static void checkPermits(int permits) { - checkArgument(permits > 0, "Requested permits (%s) must be positive", permits); - } + /* + * We always hold the mutex when calling this. + */ + protected abstract long readMicros(); - /** Invokes {@code unit.}{@link TimeUnit#sleep(long) sleep(sleepFor)} uninterruptibly. */ - private static void sleepUninterruptibly(long sleepFor, TimeUnit unit) { - boolean interrupted = false; - try { - long remainingNanos = unit.toNanos(sleepFor); - long end = System.nanoTime() + remainingNanos; - while (true) { - try { - // TimeUnit.sleep() treats negative timeouts just like zero. - NANOSECONDS.sleep(remainingNanos); - return; - } catch (InterruptedException e) { - interrupted = true; - remainingNanos = end - System.nanoTime(); - } - } - } finally { - if (interrupted) { - Thread.currentThread().interrupt(); - } - } + protected abstract void sleepMicrosUninterruptibly(long micros); } } diff --git a/src/main/java/com/google/maps/internal/ratelimiter/SmoothRateLimiter.java b/src/main/java/com/google/maps/internal/ratelimiter/SmoothRateLimiter.java index 346358227..2451163bd 100644 --- a/src/main/java/com/google/maps/internal/ratelimiter/SmoothRateLimiter.java +++ b/src/main/java/com/google/maps/internal/ratelimiter/SmoothRateLimiter.java @@ -149,6 +149,87 @@ abstract class SmoothRateLimiter extends RateLimiter { * we would only increase it for arrivals _later_ than the expected one second. */ + /** The currently stored permits. */ + double storedPermits; + + /** The maximum number of stored permits. */ + double maxPermits; + + /** + * The interval between two unit requests, at our stable rate. E.g., a stable rate of 5 permits + * per second has a stable interval of 200ms. + */ + double stableIntervalMicros; + + /** + * The time when the next request (no matter its size) will be granted. After granting a request, + * this is pushed further in the future. Large requests push this further than small requests. + */ + private long nextFreeTicketMicros = 0L; // could be either in the past or future + + private SmoothRateLimiter(SleepingStopwatch stopwatch) { + super(stopwatch); + } + + @Override + final void doSetRate(double permitsPerSecond, long nowMicros) { + resync(nowMicros); + double stableIntervalMicros = SECONDS.toMicros(1L) / permitsPerSecond; + this.stableIntervalMicros = stableIntervalMicros; + doSetRate(permitsPerSecond, stableIntervalMicros); + } + + abstract void doSetRate(double permitsPerSecond, double stableIntervalMicros); + + @Override + final double doGetRate() { + return SECONDS.toMicros(1L) / stableIntervalMicros; + } + + @Override + final long queryEarliestAvailable(long nowMicros) { + return nextFreeTicketMicros; + } + + @Override + final long reserveEarliestAvailable(int requiredPermits, long nowMicros) { + resync(nowMicros); + long returnValue = nextFreeTicketMicros; + double storedPermitsToSpend = min(requiredPermits, this.storedPermits); + double freshPermits = requiredPermits - storedPermitsToSpend; + long waitMicros = + storedPermitsToWaitTime(this.storedPermits, storedPermitsToSpend) + + (long) (freshPermits * stableIntervalMicros); + + this.nextFreeTicketMicros = LongMath.saturatedAdd(nextFreeTicketMicros, waitMicros); + this.storedPermits -= storedPermitsToSpend; + return returnValue; + } + + /** + * Translates a specified portion of our currently stored permits which we want to spend/acquire, + * into a throttling time. Conceptually, this evaluates the integral of the underlying function we + * use, for the range of [(storedPermits - permitsToTake), storedPermits]. + * + *

This always holds: {@code 0 <= permitsToTake <= storedPermits} + */ + abstract long storedPermitsToWaitTime(double storedPermits, double permitsToTake); + + /** + * Returns the number of microseconds during cool down that we have to wait to get a new permit. + */ + abstract double coolDownIntervalMicros(); + + /** Updates {@code storedPermits} and {@code nextFreeTicketMicros} based on the current time. */ + void resync(long nowMicros) { + // if nextFreeTicket is in the past, resync to now + if (nowMicros > nextFreeTicketMicros) { + double newPermits = (nowMicros - nextFreeTicketMicros) / coolDownIntervalMicros(); + storedPermits = min(maxPermits, storedPermits + newPermits); + nextFreeTicketMicros = nowMicros; + } + } + /** * This implements the following function where coldInterval = coldFactor * stableInterval. * @@ -171,7 +252,7 @@ abstract class SmoothRateLimiter extends RateLimiter { * 0 thresholdPermits maxPermits * * - * Before going into the details of this particular function, let's keep in mind the basics: + *

Before going into the details of this particular function, let's keep in mind the basics: * *

    *
  1. The state of the RateLimiter (storedPermits) is a vertical line in this figure. @@ -214,6 +295,7 @@ abstract class SmoothRateLimiter extends RateLimiter { */ static final class SmoothWarmingUp extends SmoothRateLimiter { private final long warmupPeriodMicros; + /** * The slope of the line from the stable interval (when permits == 0), to the cold interval * (when permits == maxPermits) @@ -317,85 +399,4 @@ long storedPermitsToWaitTime(double storedPermits, double permitsToTake) { return stableIntervalMicros; } } - - /** The currently stored permits. */ - double storedPermits; - - /** The maximum number of stored permits. */ - double maxPermits; - - /** - * The interval between two unit requests, at our stable rate. E.g., a stable rate of 5 permits - * per second has a stable interval of 200ms. - */ - double stableIntervalMicros; - - /** - * The time when the next request (no matter its size) will be granted. After granting a request, - * this is pushed further in the future. Large requests push this further than small requests. - */ - private long nextFreeTicketMicros = 0L; // could be either in the past or future - - private SmoothRateLimiter(SleepingStopwatch stopwatch) { - super(stopwatch); - } - - @Override - final void doSetRate(double permitsPerSecond, long nowMicros) { - resync(nowMicros); - double stableIntervalMicros = SECONDS.toMicros(1L) / permitsPerSecond; - this.stableIntervalMicros = stableIntervalMicros; - doSetRate(permitsPerSecond, stableIntervalMicros); - } - - abstract void doSetRate(double permitsPerSecond, double stableIntervalMicros); - - @Override - final double doGetRate() { - return SECONDS.toMicros(1L) / stableIntervalMicros; - } - - @Override - final long queryEarliestAvailable(long nowMicros) { - return nextFreeTicketMicros; - } - - @Override - final long reserveEarliestAvailable(int requiredPermits, long nowMicros) { - resync(nowMicros); - long returnValue = nextFreeTicketMicros; - double storedPermitsToSpend = min(requiredPermits, this.storedPermits); - double freshPermits = requiredPermits - storedPermitsToSpend; - long waitMicros = - storedPermitsToWaitTime(this.storedPermits, storedPermitsToSpend) - + (long) (freshPermits * stableIntervalMicros); - - this.nextFreeTicketMicros = LongMath.saturatedAdd(nextFreeTicketMicros, waitMicros); - this.storedPermits -= storedPermitsToSpend; - return returnValue; - } - - /** - * Translates a specified portion of our currently stored permits which we want to spend/acquire, - * into a throttling time. Conceptually, this evaluates the integral of the underlying function we - * use, for the range of [(storedPermits - permitsToTake), storedPermits]. - * - *

    This always holds: {@code 0 <= permitsToTake <= storedPermits} - */ - abstract long storedPermitsToWaitTime(double storedPermits, double permitsToTake); - - /** - * Returns the number of microseconds during cool down that we have to wait to get a new permit. - */ - abstract double coolDownIntervalMicros(); - - /** Updates {@code storedPermits} and {@code nextFreeTicketMicros} based on the current time. */ - void resync(long nowMicros) { - // if nextFreeTicket is in the past, resync to now - if (nowMicros > nextFreeTicketMicros) { - double newPermits = (nowMicros - nextFreeTicketMicros) / coolDownIntervalMicros(); - storedPermits = min(maxPermits, storedPermits + newPermits); - nextFreeTicketMicros = nowMicros; - } - } } diff --git a/src/main/java/com/google/maps/internal/ratelimiter/Stopwatch.java b/src/main/java/com/google/maps/internal/ratelimiter/Stopwatch.java index 167dcc24b..00d826342 100644 --- a/src/main/java/com/google/maps/internal/ratelimiter/Stopwatch.java +++ b/src/main/java/com/google/maps/internal/ratelimiter/Stopwatch.java @@ -30,13 +30,7 @@ import static com.google.maps.internal.ratelimiter.Preconditions.checkNotNull; import static com.google.maps.internal.ratelimiter.Preconditions.checkState; -import static java.util.concurrent.TimeUnit.DAYS; -import static java.util.concurrent.TimeUnit.HOURS; -import static java.util.concurrent.TimeUnit.MICROSECONDS; -import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static java.util.concurrent.TimeUnit.MINUTES; -import static java.util.concurrent.TimeUnit.NANOSECONDS; -import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.concurrent.TimeUnit.*; import java.util.concurrent.TimeUnit; @@ -93,6 +87,14 @@ public final class Stopwatch { private long elapsedNanos; private long startTick; + Stopwatch() { + this.ticker = Ticker.systemTicker(); + } + + Stopwatch(Ticker ticker) { + this.ticker = checkNotNull(ticker, "ticker"); + } + /** * Creates (but does not start) a new stopwatch using {@link System#nanoTime} as its time source. */ @@ -115,12 +117,47 @@ public static Stopwatch createStarted(Ticker ticker) { return new Stopwatch(ticker).start(); } - Stopwatch() { - this.ticker = Ticker.systemTicker(); + private static TimeUnit chooseUnit(long nanos) { + if (DAYS.convert(nanos, NANOSECONDS) > 0) { + return DAYS; + } + if (HOURS.convert(nanos, NANOSECONDS) > 0) { + return HOURS; + } + if (MINUTES.convert(nanos, NANOSECONDS) > 0) { + return MINUTES; + } + if (SECONDS.convert(nanos, NANOSECONDS) > 0) { + return SECONDS; + } + if (MILLISECONDS.convert(nanos, NANOSECONDS) > 0) { + return MILLISECONDS; + } + if (MICROSECONDS.convert(nanos, NANOSECONDS) > 0) { + return MICROSECONDS; + } + return NANOSECONDS; } - Stopwatch(Ticker ticker) { - this.ticker = checkNotNull(ticker, "ticker"); + private static String abbreviate(TimeUnit unit) { + switch (unit) { + case NANOSECONDS: + return "ns"; + case MICROSECONDS: + return "\u03bcs"; // μs + case MILLISECONDS: + return "ms"; + case SECONDS: + return "s"; + case MINUTES: + return "min"; + case HOURS: + return "h"; + case DAYS: + return "d"; + default: + throw new AssertionError(); + } } /** @@ -196,47 +233,4 @@ public String toString() { // Too bad this functionality is not exposed as a regular method call return Platform.formatCompact4Digits(value) + " " + abbreviate(unit); } - - private static TimeUnit chooseUnit(long nanos) { - if (DAYS.convert(nanos, NANOSECONDS) > 0) { - return DAYS; - } - if (HOURS.convert(nanos, NANOSECONDS) > 0) { - return HOURS; - } - if (MINUTES.convert(nanos, NANOSECONDS) > 0) { - return MINUTES; - } - if (SECONDS.convert(nanos, NANOSECONDS) > 0) { - return SECONDS; - } - if (MILLISECONDS.convert(nanos, NANOSECONDS) > 0) { - return MILLISECONDS; - } - if (MICROSECONDS.convert(nanos, NANOSECONDS) > 0) { - return MICROSECONDS; - } - return NANOSECONDS; - } - - private static String abbreviate(TimeUnit unit) { - switch (unit) { - case NANOSECONDS: - return "ns"; - case MICROSECONDS: - return "\u03bcs"; // μs - case MILLISECONDS: - return "ms"; - case SECONDS: - return "s"; - case MINUTES: - return "min"; - case HOURS: - return "h"; - case DAYS: - return "d"; - default: - throw new AssertionError(); - } - } } diff --git a/src/main/java/com/google/maps/internal/ratelimiter/Ticker.java b/src/main/java/com/google/maps/internal/ratelimiter/Ticker.java index c3d5880d8..505bad615 100644 --- a/src/main/java/com/google/maps/internal/ratelimiter/Ticker.java +++ b/src/main/java/com/google/maps/internal/ratelimiter/Ticker.java @@ -38,22 +38,22 @@ * @author Kevin Bourrillion */ public abstract class Ticker { + private static final Ticker SYSTEM_TICKER = + new Ticker() { + @Override + public long read() { + return Platform.systemNanoTime(); + } + }; + /** Constructor for use by subclasses. */ protected Ticker() {} - /** Returns the number of nanoseconds elapsed since this ticker's fixed point of reference. */ - public abstract long read(); - /** A ticker that reads the current time using {@link System#nanoTime}. */ public static Ticker systemTicker() { return SYSTEM_TICKER; } - private static final Ticker SYSTEM_TICKER = - new Ticker() { - @Override - public long read() { - return Platform.systemNanoTime(); - } - }; + /** Returns the number of nanoseconds elapsed since this ticker's fixed point of reference. */ + public abstract long read(); } diff --git a/src/main/java/com/google/maps/metrics/OpenCensusMetrics.java b/src/main/java/com/google/maps/metrics/OpenCensusMetrics.java index b6be49050..075200d73 100644 --- a/src/main/java/com/google/maps/metrics/OpenCensusMetrics.java +++ b/src/main/java/com/google/maps/metrics/OpenCensusMetrics.java @@ -1,13 +1,9 @@ package com.google.maps.metrics; -import io.opencensus.stats.Aggregation; +import io.opencensus.stats.*; import io.opencensus.stats.Aggregation.Count; import io.opencensus.stats.Aggregation.Distribution; -import io.opencensus.stats.BucketBoundaries; import io.opencensus.stats.Measure.MeasureLong; -import io.opencensus.stats.Stats; -import io.opencensus.stats.View; -import io.opencensus.stats.ViewManager; import io.opencensus.tags.TagKey; import java.util.Arrays; import java.util.Collections; @@ -19,46 +15,58 @@ public final class OpenCensusMetrics { private OpenCensusMetrics() {} - public static final class Tags { - private Tags() {} + public static void registerAllViews() { + registerAllViews(Stats.getViewManager()); + } + + public static void registerAllViews(ViewManager viewManager) { + View[] views_to_register = + new View[] { + Views.REQUEST_COUNT, Views.REQUEST_LATENCY, Views.NETWORK_LATENCY, Views.RETRY_COUNT + }; + for (View view : views_to_register) { + viewManager.registerView(view); + } + } + private static List tags(TagKey... items) { + return Collections.unmodifiableList(Arrays.asList(items)); + } + + public static final class Tags { public static final TagKey REQUEST_NAME = TagKey.create("request_name"); public static final TagKey HTTP_CODE = TagKey.create("http_code"); public static final TagKey API_STATUS = TagKey.create("api_status"); + + private Tags() {} } public static final class Measures { - private Measures() {} - public static final MeasureLong LATENCY = MeasureLong.create( "maps.googleapis.com/measure/client/latency", "Total time between library method called and results returned", "ms"); - public static final MeasureLong NETWORK_LATENCY = MeasureLong.create( "maps.googleapis.com/measure/client/network_latency", "Network time inside the library", "ms"); - public static final MeasureLong RETRY_COUNT = MeasureLong.create( "maps.googleapis.com/measure/client/retry_count", "How many times any request was retried", "1"); + + private Measures() {} } private static final class Aggregations { - private Aggregations() {} - private static final Aggregation COUNT = Count.create(); - private static final Aggregation DISTRIBUTION_INTEGERS_10 = Distribution.create( BucketBoundaries.create( Arrays.asList(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0))); - // every bucket is ~25% bigger = 20 * 2^(N/3) private static final Aggregation DISTRIBUTION_LATENCY = Distribution.create( @@ -67,14 +75,13 @@ private Aggregations() {} 0.0, 20.0, 25.2, 31.7, 40.0, 50.4, 63.5, 80.0, 100.8, 127.0, 160.0, 201.6, 254.0, 320.0, 403.2, 508.0, 640.0, 806.3, 1015.9, 1280.0, 1612.7, 2031.9, 2560.0, 3225.4, 4063.7))); + + private Aggregations() {} } public static final class Views { - private Views() {} - private static final List fields = tags(Tags.REQUEST_NAME, Tags.HTTP_CODE, Tags.API_STATUS); - public static final View REQUEST_COUNT = View.create( View.Name.create("maps.googleapis.com/client/request_count"), @@ -82,7 +89,6 @@ private Views() {} Measures.LATENCY, Aggregations.COUNT, fields); - public static final View REQUEST_LATENCY = View.create( View.Name.create("maps.googleapis.com/client/request_latency"), @@ -90,7 +96,6 @@ private Views() {} Measures.LATENCY, Aggregations.DISTRIBUTION_LATENCY, fields); - public static final View NETWORK_LATENCY = View.create( View.Name.create("maps.googleapis.com/client/network_latency"), @@ -98,7 +103,6 @@ private Views() {} Measures.NETWORK_LATENCY, Aggregations.DISTRIBUTION_LATENCY, fields); - public static final View RETRY_COUNT = View.create( View.Name.create("maps.googleapis.com/client/retry_count"), @@ -106,23 +110,7 @@ private Views() {} Measures.RETRY_COUNT, Aggregations.DISTRIBUTION_INTEGERS_10, fields); - } - public static void registerAllViews() { - registerAllViews(Stats.getViewManager()); - } - - public static void registerAllViews(ViewManager viewManager) { - View[] views_to_register = - new View[] { - Views.REQUEST_COUNT, Views.REQUEST_LATENCY, Views.NETWORK_LATENCY, Views.RETRY_COUNT - }; - for (View view : views_to_register) { - viewManager.registerView(view); - } - } - - private static List tags(TagKey... items) { - return Collections.unmodifiableList(Arrays.asList(items)); + private Views() {} } } diff --git a/src/main/java/com/google/maps/model/AutocompletePrediction.java b/src/main/java/com/google/maps/model/AutocompletePrediction.java index 8e8850b4a..053148430 100644 --- a/src/main/java/com/google/maps/model/AutocompletePrediction.java +++ b/src/main/java/com/google/maps/model/AutocompletePrediction.java @@ -58,6 +58,28 @@ public class AutocompletePrediction implements Serializable { */ public Integer distanceMeters; + /** + * The locations of the entered term in the prediction result text, so that the term can be + * highlighted if desired. + */ + public MatchedSubstring matchedSubstrings[]; + + /** A description of how the autocomplete query matched the returned result. */ + public AutocompleteStructuredFormatting structuredFormatting; + + @Override + public String toString() { + return String.format( + "[AutocompletePrediction: \"%s\", placeId=%s, types=%s, terms=%s, " + + "matchedSubstrings=%s, structuredFormatting=%s]", + description, + placeId, + Arrays.toString(types), + Arrays.toString(terms), + Arrays.toString(matchedSubstrings), + Objects.toString(structuredFormatting)); + } + /** * Describes the location of the entered term in the prediction result text, so that the term can * be highlighted if desired. @@ -78,15 +100,6 @@ public String toString() { } } - /** - * The locations of the entered term in the prediction result text, so that the term can be - * highlighted if desired. - */ - public MatchedSubstring matchedSubstrings[]; - - /** A description of how the autocomplete query matched the returned result. */ - public AutocompleteStructuredFormatting structuredFormatting; - /** * Identifies each section of the returned description. (A section of the description is generally * terminated with a comma.) @@ -106,17 +119,4 @@ public String toString() { return String.format("(offset=%d, value=%s)", offset, value); } } - - @Override - public String toString() { - return String.format( - "[AutocompletePrediction: \"%s\", placeId=%s, types=%s, terms=%s, " - + "matchedSubstrings=%s, structuredFormatting=%s]", - description, - placeId, - Arrays.toString(types), - Arrays.toString(terms), - Arrays.toString(matchedSubstrings), - Objects.toString(structuredFormatting)); - } } diff --git a/src/main/java/com/google/maps/model/Bounds.java b/src/main/java/com/google/maps/model/Bounds.java index b26c036c5..6b263e2ee 100644 --- a/src/main/java/com/google/maps/model/Bounds.java +++ b/src/main/java/com/google/maps/model/Bounds.java @@ -21,8 +21,10 @@ public class Bounds implements Serializable { private static final long serialVersionUID = 1L; + /** The northeast corner of the bounding box. */ public LatLng northeast; + /** The southwest corner of the bounding box. */ public LatLng southwest; diff --git a/src/main/java/com/google/maps/model/CellTower.java b/src/main/java/com/google/maps/model/CellTower.java index 2b39905d2..1ce95fc36 100644 --- a/src/main/java/com/google/maps/model/CellTower.java +++ b/src/main/java/com/google/maps/model/CellTower.java @@ -30,25 +30,6 @@ public class CellTower implements Serializable { private static final long serialVersionUID = 1L; - public CellTower() {} - - // constructor only used by the builder class below - private CellTower( - Integer _cellId, - Integer _locationAreaCode, - Integer _mobileCountryCode, - Integer _mobileNetworkCode, - Integer _age, - Integer _signalStrength, - Integer _timingAdvance) { - this.cellId = _cellId; - this.locationAreaCode = _locationAreaCode; - this.mobileCountryCode = _mobileCountryCode; - this.mobileNetworkCode = _mobileNetworkCode; - this.age = _age; - this.signalStrength = _signalStrength; - this.timingAdvance = _timingAdvance; - } /** * Unique identifier of the cell (required). On GSM, this is the Cell ID (CID); CDMA networks use * the Base Station ID (BID). WCDMA networks use the UTRAN/GERAN Cell Identity (UC-Id), which is a @@ -56,29 +37,55 @@ private CellTower( * 16-bit Cell ID value in WCDMA networks may return inaccurate results. */ public Integer cellId = null; + /** * The Location Area Code (LAC) for GSM and WCDMAnetworks or The Network ID (NID) for CDMA * networks (required). */ public Integer locationAreaCode = null; + /** The cell tower's Mobile Country Code (MCC) (required). */ public Integer mobileCountryCode = null; + /** * The cell tower's Mobile Network Code (required). This is the MNC for GSM and WCDMA; CDMA uses * the System ID (SID). */ public Integer mobileNetworkCode = null; - /* The following optional fields are not currently used, but may be included if values are available. */ + /** * The number of milliseconds since this cell was primary. If age is 0, the cellId represents a * current measurement. */ public Integer age = null; + /** Radio signal strength measured in dBm. */ public Integer signalStrength = null; + + /* The following optional fields are not currently used, but may be included if values are available. */ /** The timing advance value. */ public Integer timingAdvance = null; + public CellTower() {} + + // constructor only used by the builder class below + private CellTower( + Integer _cellId, + Integer _locationAreaCode, + Integer _mobileCountryCode, + Integer _mobileNetworkCode, + Integer _age, + Integer _signalStrength, + Integer _timingAdvance) { + this.cellId = _cellId; + this.locationAreaCode = _locationAreaCode; + this.mobileCountryCode = _mobileCountryCode; + this.mobileNetworkCode = _mobileNetworkCode; + this.age = _age; + this.signalStrength = _signalStrength; + this.timingAdvance = _timingAdvance; + } + @Override public String toString() { return String.format( diff --git a/src/main/java/com/google/maps/model/ComponentFilter.java b/src/main/java/com/google/maps/model/ComponentFilter.java index 0c5cc887a..87116f637 100644 --- a/src/main/java/com/google/maps/model/ComponentFilter.java +++ b/src/main/java/com/google/maps/model/ComponentFilter.java @@ -43,16 +43,6 @@ public ComponentFilter(String component, String value) { this.value = value; } - @Override - public String toString() { - return toUrlValue(); - } - - @Override - public String toUrlValue() { - return join(':', component, value); - } - /** * Matches long or short name of a route. * @@ -102,4 +92,14 @@ public static ComponentFilter postalCode(String postalCode) { public static ComponentFilter country(String country) { return new ComponentFilter("country", country); } + + @Override + public String toString() { + return toUrlValue(); + } + + @Override + public String toUrlValue() { + return join(':', component, value); + } } diff --git a/src/main/java/com/google/maps/model/DirectionsRoute.java b/src/main/java/com/google/maps/model/DirectionsRoute.java index 7fbada10e..1eae66e65 100644 --- a/src/main/java/com/google/maps/model/DirectionsRoute.java +++ b/src/main/java/com/google/maps/model/DirectionsRoute.java @@ -29,6 +29,7 @@ public class DirectionsRoute implements Serializable { private static final long serialVersionUID = 1L; + /** * A short textual description for the route, suitable for naming and disambiguating the route * from alternatives. diff --git a/src/main/java/com/google/maps/model/ElevationResult.java b/src/main/java/com/google/maps/model/ElevationResult.java index 46e4b8ec2..fad4398e3 100644 --- a/src/main/java/com/google/maps/model/ElevationResult.java +++ b/src/main/java/com/google/maps/model/ElevationResult.java @@ -28,8 +28,10 @@ public class ElevationResult implements Serializable { /** Elevation in meters. */ public double elevation; + /** Location of the elevation data. */ public LatLng location; + /** Maximum distance between data points from which the elevation was interpolated, in meters. */ public double resolution; diff --git a/src/main/java/com/google/maps/model/EncodedPolyline.java b/src/main/java/com/google/maps/model/EncodedPolyline.java index 07f75ddeb..f4dee9c02 100644 --- a/src/main/java/com/google/maps/model/EncodedPolyline.java +++ b/src/main/java/com/google/maps/model/EncodedPolyline.java @@ -42,7 +42,9 @@ public EncodedPolyline(String encodedPoints) { this.points = encodedPoints; } - /** @param points A path as a collection of {@code LatLng} points. */ + /** + * @param points A path as a collection of {@code LatLng} points. + */ public EncodedPolyline(List points) { this.points = PolylineEncoding.encode(points); } diff --git a/src/main/java/com/google/maps/model/GeolocationPayload.java b/src/main/java/com/google/maps/model/GeolocationPayload.java index 640169816..d29bff445 100644 --- a/src/main/java/com/google/maps/model/GeolocationPayload.java +++ b/src/main/java/com/google/maps/model/GeolocationPayload.java @@ -37,48 +37,55 @@ public class GeolocationPayload implements Serializable { private static final long serialVersionUID = 1L; - public GeolocationPayload() {} - - // constructor only used by the builder class below - private GeolocationPayload( - Integer _homeMobileCountryCode, - Integer _homeMobileNetworkCode, - String _radioType, - String _carrier, - Boolean _considerIp, - CellTower[] _cellTowers, - WifiAccessPoint[] _wifiAccessPoints) { - homeMobileCountryCode = _homeMobileCountryCode; - homeMobileNetworkCode = _homeMobileNetworkCode; - radioType = _radioType; - carrier = _carrier; - considerIp = _considerIp; - cellTowers = _cellTowers; - wifiAccessPoints = _wifiAccessPoints; - } /** The mobile country code (MCC) for the device's home network. */ public Integer homeMobileCountryCode = null; + /** The mobile network code (MNC) for the device's home network. */ public Integer homeMobileNetworkCode = null; + /** * The mobile radio type. Supported values are {@code "lte"}, {@code "gsm"}, {@code "cdma"}, and * {@code "wcdma"}. While this field is optional, it should be included if a value is available, * for more accurate results. */ public String radioType = null; + /** The carrier name. */ public String carrier = null; + /** * Specifies whether to fall back to IP geolocation if wifi and cell tower signals are not * available. Note that the IP address in the request header may not be the IP of the device. * Defaults to true. Set considerIp to false to disable fall back. */ public Boolean considerIp = null; + /** An array of cell tower objects. See {@link com.google.maps.model.CellTower}. */ public CellTower[] cellTowers; + /** An array of WiFi access point objects. See {@link com.google.maps.model.WifiAccessPoint}. */ public WifiAccessPoint[] wifiAccessPoints; + public GeolocationPayload() {} + + // constructor only used by the builder class below + private GeolocationPayload( + Integer _homeMobileCountryCode, + Integer _homeMobileNetworkCode, + String _radioType, + String _carrier, + Boolean _considerIp, + CellTower[] _cellTowers, + WifiAccessPoint[] _wifiAccessPoints) { + homeMobileCountryCode = _homeMobileCountryCode; + homeMobileNetworkCode = _homeMobileNetworkCode; + radioType = _radioType; + carrier = _carrier; + considerIp = _considerIp; + cellTowers = _cellTowers; + wifiAccessPoints = _wifiAccessPoints; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("[GeolocationPayload"); diff --git a/src/main/java/com/google/maps/model/GeolocationResult.java b/src/main/java/com/google/maps/model/GeolocationResult.java index 45e7e097d..ae43db890 100644 --- a/src/main/java/com/google/maps/model/GeolocationResult.java +++ b/src/main/java/com/google/maps/model/GeolocationResult.java @@ -29,8 +29,10 @@ public class GeolocationResult implements Serializable { private static final long serialVersionUID = 1L; + /** The user’s estimated latitude and longitude. */ public LatLng location; + /** * The accuracy of the estimated location, in meters. This represents the radius of a circle * around the returned {@code location}. diff --git a/src/main/java/com/google/maps/model/Geometry.java b/src/main/java/com/google/maps/model/Geometry.java index 87b8ba972..ddfce9edc 100644 --- a/src/main/java/com/google/maps/model/Geometry.java +++ b/src/main/java/com/google/maps/model/Geometry.java @@ -21,6 +21,7 @@ public class Geometry implements Serializable { private static final long serialVersionUID = 1L; + /** * The bounding box which can fully contain the returned result (optionally returned). Note that * these bounds may not match the recommended viewport. (For example, San Francisco includes the diff --git a/src/main/java/com/google/maps/model/OpeningHours.java b/src/main/java/com/google/maps/model/OpeningHours.java index 61d607029..d387dceb7 100644 --- a/src/main/java/com/google/maps/model/OpeningHours.java +++ b/src/main/java/com/google/maps/model/OpeningHours.java @@ -27,6 +27,7 @@ public class OpeningHours implements Serializable { private static final long serialVersionUID = 1L; + /** * Whether the place is open at the current time. * @@ -34,15 +35,72 @@ public class OpeningHours implements Serializable { */ public Boolean openNow; + /** Opening periods covering seven days, starting from Sunday, in chronological order. */ + public Period[] periods; + + /** An array of up to seven entries corresponding to the next seven days. */ + public SpecialDay[] specialDays; + + /** + * A type string used to identify the type of secondary hours (for example, DRIVE_THROUGH, + * HAPPY_HOUR, DELIVERY, TAKEOUT, KITCHEN, BREAKFAST, LUNCH, DINNER, BRUNCH, PICKUP, + * SENIOR_HOURS). Set for secondary_opening_hours only. + */ + public String type; + + /** + * The formatted opening hours for each day of the week, as an array of seven strings; for + * example, {@code "Monday: 8:30 am – 5:30 pm"}. + */ + public String[] weekdayText; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("[OpeningHours:"); + if (openNow != null && openNow) { + sb.append(" openNow"); + } + sb.append(" ").append(Arrays.toString(periods)); + if (specialDays != null) { + sb.append(" (\"").append(specialDays).append("\")"); + } + if (type != null) { + sb.append(" (\"").append(type).append("\")"); + } + return sb.toString(); + } + /** The opening hours for a Place for a single day. */ public static class Period implements Serializable { private static final long serialVersionUID = 1L; + /** When the Place opens. */ + public Period.OpenClose open; + + /** When the Place closes. */ + public Period.OpenClose close; + + @Override + public String toString() { + return String.format("%s - %s", open, close); + } + public static class OpenClose implements Serializable { private static final long serialVersionUID = 1L; + /** Day that this Open/Close pair is for. */ + public Period.OpenClose.DayOfWeek day; + + /** Time that this Open or Close happens at. */ + public LocalTime time; + + @Override + public String toString() { + return String.format("%s %s", day, time); + } + public enum DayOfWeek { SUNDAY("Sunday"), MONDAY("Monday"), @@ -58,44 +116,19 @@ public enum DayOfWeek { */ UNKNOWN("Unknown"); + private final String name; + private DayOfWeek(String name) { this.name = name; } - private final String name; - public String getName() { return name; } } - - /** Day that this Open/Close pair is for. */ - public Period.OpenClose.DayOfWeek day; - - /** Time that this Open or Close happens at. */ - public LocalTime time; - - @Override - public String toString() { - return String.format("%s %s", day, time); - } - } - - /** When the Place opens. */ - public Period.OpenClose open; - - /** When the Place closes. */ - public Period.OpenClose close; - - @Override - public String toString() { - return String.format("%s - %s", open, close); } } - /** Opening periods covering seven days, starting from Sunday, in chronological order. */ - public Period[] periods; - /** An indicator of special hours for a Place for a single day. */ public static class SpecialDay implements Serializable { @@ -128,36 +161,4 @@ public String toString() { return sb.toString(); } } - - /** An array of up to seven entries corresponding to the next seven days. */ - public SpecialDay[] specialDays; - - /** - * A type string used to identify the type of secondary hours (for example, DRIVE_THROUGH, - * HAPPY_HOUR, DELIVERY, TAKEOUT, KITCHEN, BREAKFAST, LUNCH, DINNER, BRUNCH, PICKUP, - * SENIOR_HOURS). Set for secondary_opening_hours only. - */ - public String type; - - /** - * The formatted opening hours for each day of the week, as an array of seven strings; for - * example, {@code "Monday: 8:30 am – 5:30 pm"}. - */ - public String[] weekdayText; - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("[OpeningHours:"); - if (openNow != null && openNow) { - sb.append(" openNow"); - } - sb.append(" ").append(Arrays.toString(periods)); - if (specialDays != null) { - sb.append(" (\"").append(specialDays).append("\")"); - } - if (type != null) { - sb.append(" (\"").append(type).append("\")"); - } - return sb.toString(); - } } diff --git a/src/main/java/com/google/maps/model/Photo.java b/src/main/java/com/google/maps/model/Photo.java index ae16a5cb2..b5c108783 100644 --- a/src/main/java/com/google/maps/model/Photo.java +++ b/src/main/java/com/google/maps/model/Photo.java @@ -26,6 +26,7 @@ public class Photo implements Serializable { private static final long serialVersionUID = 1L; + /** Used to identify the photo when you perform a Photo request. */ public String photoReference; diff --git a/src/main/java/com/google/maps/model/PlaceAutocompleteType.java b/src/main/java/com/google/maps/model/PlaceAutocompleteType.java index 3e10c3471..7224d8c1c 100644 --- a/src/main/java/com/google/maps/model/PlaceAutocompleteType.java +++ b/src/main/java/com/google/maps/model/PlaceAutocompleteType.java @@ -28,12 +28,12 @@ public enum PlaceAutocompleteType implements StringJoin.UrlValue { REGIONS("(regions)"), CITIES("(cities)"); + private final String placeType; + PlaceAutocompleteType(final String placeType) { this.placeType = placeType; } - private final String placeType; - @Override public String toUrlValue() { return placeType; diff --git a/src/main/java/com/google/maps/model/PlaceDetails.java b/src/main/java/com/google/maps/model/PlaceDetails.java index a9f52b0cb..b2f999454 100644 --- a/src/main/java/com/google/maps/model/PlaceDetails.java +++ b/src/main/java/com/google/maps/model/PlaceDetails.java @@ -112,30 +112,6 @@ public class PlaceDetails implements Serializable { */ public PriceLevel priceLevel; - @Deprecated - public static class AlternatePlaceIds implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * The alternative placeId. The most likely reason for a place to have an alternative place ID - * is if your application adds a place and receives an application-scoped place ID, then later - * receives a Google-scoped place ID after passing the moderation process. - */ - public String placeId; - - /** - * The scope of an alternative place ID will always be APP, indicating that the alternative - * place ID is recognised by your application only. - */ - @Deprecated public PlaceIdScope scope; - - @Override - public String toString() { - return String.format("%s (%s)", placeId, scope); - } - } - /** * An optional array of alternative place IDs for the place, with a scope related to each * alternative ID. @@ -145,79 +121,6 @@ public String toString() { /** The place's rating, from 1.0 to 5.0, based on aggregated user reviews. */ public float rating; - public static class Review implements Serializable { - - private static final long serialVersionUID = 1L; - - public static class AspectRating implements Serializable { - - private static final long serialVersionUID = 1L; - - public enum RatingType { - APPEAL, - ATMOSPHERE, - DECOR, - FACILITIES, - FOOD, - OVERALL, - QUALITY, - SERVICE, - - /** - * Indicates an unknown rating type returned by the server. The Java Client for Google Maps - * Services should be updated to support the new value. - */ - UNKNOWN - } - - /** The name of the aspect that is being rated. */ - public RatingType type; - - /** The user's rating for this particular aspect, from 0 to 3. */ - public int rating; - } - - /** - * A list of AspectRating objects, each of which provides a rating of a single attribute of the - * establishment. - * - *

    Note: this is a Premium Data field - * available to the Google Places API for Work customers. - */ - public AspectRating[] aspects; - - /** - * The name of the user who submitted the review. Anonymous reviews are attributed to "A Google - * user". - */ - public String authorName; - - /** The URL of the user's Google+ profile, if available. */ - public URL authorUrl; - - /** An IETF language code indicating the language used in the user's review. */ - public String language; - - /** The URL of the user's Google+ profile photo, if available. */ - public String profilePhotoUrl; - - /** The user's overall rating for this place. This is a whole number, ranging from 1 to 5. */ - public int rating; - - /** The relative time that the review was submitted. */ - public String relativeTimeDescription; - - /** - * The user's review. When reviewing a location with Google Places, text reviews are considered - * optional. - */ - public String text; - - /** The time that the review was submitted. */ - public Instant time; - } - /** Specifies if the place supports reservations. */ public Boolean reservable; @@ -327,18 +230,8 @@ public String toString() { if (altIds != null && altIds.length > 0) { sb.append(", altIds=").append(Arrays.toString(altIds)); } - if (formattedPhoneNumber != null) { - sb.append(", phone=").append(formattedPhoneNumber); - } - if (internationalPhoneNumber != null) { - sb.append(", internationalPhoneNumber=").append(internationalPhoneNumber); - } - if (url != null) { - sb.append(", url=").append(url); - } - if (website != null) { - sb.append(", website=").append(website); - } + sb.append(addPhoneNumber(sb)); + sb.append(addWebsiteInfo(sb)); if (icon != null) { sb.append(", icon"); } @@ -368,6 +261,41 @@ public String toString() { if (secondaryOpeningHours != null) { sb.append(", secondaryOpeningHours=").append(secondaryOpeningHours); } + sb.append(addServingInfo(sb)); + if (takeout != null) { + sb.append(", takeout=").append(takeout); + } + if (wheelchairAccessibleEntrance != null) { + sb.append(", wheelchairAccessibleEntrance=").append(wheelchairAccessibleEntrance); + } + if (htmlAttributions != null && htmlAttributions.length > 0) { + sb.append(", ").append(htmlAttributions.length).append(" htmlAttributions"); + } + sb.append("]"); + return sb.toString(); + } + + private String addPhoneNumber(StringBuilder sb) { + if (formattedPhoneNumber != null) { + sb.append(", phone=").append(formattedPhoneNumber); + } + if (internationalPhoneNumber != null) { + sb.append(", internationalPhoneNumber=").append(internationalPhoneNumber); + } + return sb.toString(); + } + + private String addWebsiteInfo(StringBuilder sb) { + if (url != null) { + sb.append(", url=").append(url); + } + if (website != null) { + sb.append(", website=").append(website); + } + return sb.toString(); + } + + private String addServingInfo(StringBuilder sb) { if (servesBeer != null) { sb.append(", servesBeer=").append(servesBeer); } @@ -389,16 +317,103 @@ public String toString() { if (servesWine != null) { sb.append(", servesWine=").append(servesWine); } - if (takeout != null) { - sb.append(", takeout=").append(takeout); - } - if (wheelchairAccessibleEntrance != null) { - sb.append(", wheelchairAccessibleEntrance=").append(wheelchairAccessibleEntrance); + return sb.toString(); + } + + @Deprecated + public static class AlternatePlaceIds implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The alternative placeId. The most likely reason for a place to have an alternative place ID + * is if your application adds a place and receives an application-scoped place ID, then later + * receives a Google-scoped place ID after passing the moderation process. + */ + public String placeId; + + /** + * The scope of an alternative place ID will always be APP, indicating that the alternative + * place ID is recognised by your application only. + */ + @Deprecated public PlaceIdScope scope; + + @Override + public String toString() { + return String.format("%s (%s)", placeId, scope); } - if (htmlAttributions != null && htmlAttributions.length > 0) { - sb.append(", ").append(htmlAttributions.length).append(" htmlAttributions"); + } + + public static class Review implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * A list of AspectRating objects, each of which provides a rating of a single attribute of the + * establishment. + * + *

    Note: this is a Premium Data field + * available to the Google Places API for Work customers. + */ + public AspectRating[] aspects; + + /** + * The name of the user who submitted the review. Anonymous reviews are attributed to "A Google + * user". + */ + public String authorName; + + /** The URL of the user's Google+ profile, if available. */ + public URL authorUrl; + + /** An IETF language code indicating the language used in the user's review. */ + public String language; + + /** The URL of the user's Google+ profile photo, if available. */ + public String profilePhotoUrl; + + /** The user's overall rating for this place. This is a whole number, ranging from 1 to 5. */ + public int rating; + + /** The relative time that the review was submitted. */ + public String relativeTimeDescription; + + /** + * The user's review. When reviewing a location with Google Places, text reviews are considered + * optional. + */ + public String text; + + /** The time that the review was submitted. */ + public Instant time; + + public static class AspectRating implements Serializable { + + private static final long serialVersionUID = 1L; + + /** The name of the aspect that is being rated. */ + public RatingType type; + + /** The user's rating for this particular aspect, from 0 to 3. */ + public int rating; + + public enum RatingType { + APPEAL, + ATMOSPHERE, + DECOR, + FACILITIES, + FOOD, + OVERALL, + QUALITY, + SERVICE, + + /** + * Indicates an unknown rating type returned by the server. The Java Client for Google Maps + * Services should be updated to support the new value. + */ + UNKNOWN + } } - sb.append("]"); - return sb.toString(); } } diff --git a/src/main/java/com/google/maps/model/PlaceType.java b/src/main/java/com/google/maps/model/PlaceType.java index 222015747..fb2194ac3 100644 --- a/src/main/java/com/google/maps/model/PlaceType.java +++ b/src/main/java/com/google/maps/model/PlaceType.java @@ -129,12 +129,12 @@ public enum PlaceType implements StringJoin.UrlValue { VETERINARY_CARE("veterinary_care"), ZOO("zoo"); + private final String placeType; + PlaceType(final String placeType) { this.placeType = placeType; } - private final String placeType; - @Override public String toUrlValue() { return placeType; diff --git a/src/main/java/com/google/maps/model/SnappedPoint.java b/src/main/java/com/google/maps/model/SnappedPoint.java index b07b30186..585431029 100644 --- a/src/main/java/com/google/maps/model/SnappedPoint.java +++ b/src/main/java/com/google/maps/model/SnappedPoint.java @@ -21,6 +21,7 @@ public class SnappedPoint implements Serializable { private static final long serialVersionUID = 1L; + /** A latitude/longitude value representing the snapped location. */ public LatLng location; diff --git a/src/main/java/com/google/maps/model/SpeedLimit.java b/src/main/java/com/google/maps/model/SpeedLimit.java index 1e7ab1721..cdbbb35aa 100644 --- a/src/main/java/com/google/maps/model/SpeedLimit.java +++ b/src/main/java/com/google/maps/model/SpeedLimit.java @@ -21,6 +21,7 @@ public class SpeedLimit implements Serializable { private static final long serialVersionUID = 1L; + /** * A unique identifier for a place. All placeIds returned by the Roads API will correspond to road * segments. @@ -34,7 +35,9 @@ public class SpeedLimit implements Serializable { */ public double speedLimit; - /** @return Returns the speed limit in miles per hour (MPH). */ + /** + * @return Returns the speed limit in miles per hour (MPH). + */ public long speedLimitMph() { return Math.round(speedLimit * 0.621371); } diff --git a/src/main/java/com/google/maps/model/WifiAccessPoint.java b/src/main/java/com/google/maps/model/WifiAccessPoint.java index d0275d516..e5fe5b2d7 100644 --- a/src/main/java/com/google/maps/model/WifiAccessPoint.java +++ b/src/main/java/com/google/maps/model/WifiAccessPoint.java @@ -31,6 +31,24 @@ public class WifiAccessPoint implements Serializable { private static final long serialVersionUID = 1L; + /** + * The MAC address of the WiFi node (required). Separators must be {@code :} (colon) and hex + * digits must use uppercase. + */ + public String macAddress; + + /** The current signal strength measured in dBm. */ + public Integer signalStrength = null; + + /** The number of milliseconds since this access point was detected. */ + public Integer age = null; + + /** The channel over which the client is communicating with the access point. */ + public Integer channel = null; + + /** The current signal to noise ratio measured in dB. */ + public Integer signalToNoiseRatio = null; + public WifiAccessPoint() {} // constructor only used by the builder class below @@ -46,19 +64,6 @@ private WifiAccessPoint( channel = _channel; signalToNoiseRatio = _signalToNoiseRatio; } - /** - * The MAC address of the WiFi node (required). Separators must be {@code :} (colon) and hex - * digits must use uppercase. - */ - public String macAddress; - /** The current signal strength measured in dBm. */ - public Integer signalStrength = null; - /** The number of milliseconds since this access point was detected. */ - public Integer age = null; - /** The channel over which the client is communicating with the access point. */ - public Integer channel = null; - /** The current signal to noise ratio measured in dB. */ - public Integer signalToNoiseRatio = null; @Override public String toString() { diff --git a/src/test/java/com/google/maps/DirectionsApiTest.java b/src/test/java/com/google/maps/DirectionsApiTest.java index 8baa37522..af72752ff 100644 --- a/src/test/java/com/google/maps/DirectionsApiTest.java +++ b/src/test/java/com/google/maps/DirectionsApiTest.java @@ -19,25 +19,17 @@ import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; import com.google.maps.DirectionsApi.RouteRestriction; import com.google.maps.errors.NotFoundException; -import com.google.maps.model.AddressType; -import com.google.maps.model.DirectionsResult; -import com.google.maps.model.GeocodedWaypointStatus; -import com.google.maps.model.LatLng; -import com.google.maps.model.TrafficModel; -import com.google.maps.model.TransitMode; -import com.google.maps.model.TransitRoutingPreference; -import com.google.maps.model.TravelMode; -import com.google.maps.model.Unit; +import com.google.maps.model.*; import java.time.Duration; import java.time.Instant; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.hamcrest.MatcherAssert; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -72,7 +64,7 @@ public void testGetDirections() throws Exception { assertEquals(1, result.routes.length); assertNotNull(result.routes[0]); assertEquals("M31 and National Highway M31", result.routes[0].summary); - assertThat(result.routes[0].overviewPolyline.decodePath().size(), not(0)); + MatcherAssert.assertThat(result.routes[0].overviewPolyline.decodePath().size(), not(0)); assertEquals(1, result.routes[0].legs.length); assertEquals("Melbourne VIC, Australia", result.routes[0].legs[0].endAddress); assertEquals("Sydney NSW, Australia", result.routes[0].legs[0].startAddress); @@ -198,6 +190,22 @@ public void testSanFranciscoToSeattleByBicycleAvoidingIndoor() throws Exception } } + @Test + public void testNewYorkToNewJerseyByAlternateRoute() throws Exception { + try (LocalTestServerContext sc = + new LocalTestServerContext("{\"routes\": [{}],\"status\": \"OK\"}")) { + DirectionsApi.newRequest(sc.context) + .origin("New York") + .destination("New Jersey") + .alternatives(true) + .await(); + + sc.assertParamValue("New York", "origin"); + sc.assertParamValue("New Jersey", "destination"); + sc.assertParamValue("true", "alternatives"); + } + } + /** * Brooklyn to Queens by public transport. * @@ -242,6 +250,22 @@ public void testBostonToConcordViaCharlestownAndLexington() throws Exception { } } + @Test + public void testBostonToNewJerseyViaNewHavenWithPlaceId() throws Exception { + try (LocalTestServerContext sc = + new LocalTestServerContext("{\"routes\": [{}],\"status\": \"OK\"}")) { + DirectionsApi.newRequest(sc.context) + .origin("Boston,US") + .destination("New Jersey,US") + .waypointsFromPlaceIds("G5c1s86wd2d") // This is a custom dummy place ID for New Haven,US + .await(); + + sc.assertParamValue("Boston,US", "origin"); + sc.assertParamValue("New Jersey,US", "destination"); + sc.assertParamValue("place_id:G5c1s86wd2d", "waypoints"); + } + } + /** * Boston to Concord, via Charlestown and Lexington, using non-stopover waypoints. * diff --git a/src/test/java/com/google/maps/DistanceMatrixApiTest.java b/src/test/java/com/google/maps/DistanceMatrixApiTest.java index 59160159b..a9c688023 100644 --- a/src/test/java/com/google/maps/DistanceMatrixApiTest.java +++ b/src/test/java/com/google/maps/DistanceMatrixApiTest.java @@ -20,12 +20,7 @@ import static org.junit.Assert.assertNotNull; import com.google.maps.DirectionsApi.RouteRestriction; -import com.google.maps.model.DistanceMatrix; -import com.google.maps.model.DistanceMatrixElementStatus; -import com.google.maps.model.LatLng; -import com.google.maps.model.TrafficModel; -import com.google.maps.model.TravelMode; -import com.google.maps.model.Unit; +import com.google.maps.model.*; import java.time.Duration; import java.time.Instant; import java.util.Arrays; diff --git a/src/test/java/com/google/maps/GeoApiContextTest.java b/src/test/java/com/google/maps/GeoApiContextTest.java index f6c431d58..ec62bd610 100644 --- a/src/test/java/com/google/maps/GeoApiContextTest.java +++ b/src/test/java/com/google/maps/GeoApiContextTest.java @@ -16,15 +16,8 @@ package com.google.maps; import static com.google.maps.TestUtils.findLastThreadByName; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.mockStatic; -import static org.mockito.Mockito.when; +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; import com.google.maps.android.Context; import com.google.maps.android.PackageInfo; diff --git a/src/test/java/com/google/maps/GeocodingApiTest.java b/src/test/java/com/google/maps/GeocodingApiTest.java index e99e2bab9..108c13936 100644 --- a/src/test/java/com/google/maps/GeocodingApiTest.java +++ b/src/test/java/com/google/maps/GeocodingApiTest.java @@ -18,18 +18,10 @@ import static com.google.maps.TestUtils.retrieveBody; import static com.google.maps.model.ComponentFilter.administrativeArea; import static com.google.maps.model.ComponentFilter.country; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import com.google.maps.internal.HttpHeaders; -import com.google.maps.model.AddressComponentType; -import com.google.maps.model.AddressType; -import com.google.maps.model.ComponentFilter; -import com.google.maps.model.GeocodingResult; -import com.google.maps.model.LatLng; -import com.google.maps.model.LocationType; +import com.google.maps.model.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -874,7 +866,8 @@ public void testUtfResult() throws Exception { try (LocalTestServerContext sc = new LocalTestServerContext(utfResultGeocodeResponse)) { LatLng location = new LatLng(46.8023388, 1.6551867); GeocodingResult[] results = GeocodingApi.newRequest(sc.context).latlng(location).await(); - assertEquals("1 Rue Fernand Raynaud, 36000 Châteauroux, France", results[0].formattedAddress); + assertEquals( + "1 Rue Fernand Raynaud, 36000 Ch\u00E2teauroux, France", results[0].formattedAddress); sc.assertParamValue(location.toUrlValue(), "latlng"); } } @@ -998,7 +991,7 @@ public void testReverseGeocodeWithKitaWard() throws Exception { assertNotNull(results); assertNotNull(Arrays.toString(results)); assertEquals( - "Japan, 〒603-8361 Kyōto-fu, Kyōto-shi, Kita-ku, Kinkakujichō, 1 北山鹿苑寺金閣寺", + "Japan, \u3012603-8361 Ky\u014Dto-fu, Ky\u014Dto-shi, Kita-ku, Kinkakujich\u014D, \uFF11 \u5317\u5C71\u9E7F\u82D1\u5BFA\u91D1\u95A3\u5BFA", results[0].formattedAddress); assertEquals("Kita Ward", results[3].addressComponents[0].shortName); assertEquals("Kita Ward", results[3].addressComponents[0].longName); diff --git a/src/test/java/com/google/maps/GeolocationApiTest.java b/src/test/java/com/google/maps/GeolocationApiTest.java index 8388e17c0..53738eb11 100644 --- a/src/test/java/com/google/maps/GeolocationApiTest.java +++ b/src/test/java/com/google/maps/GeolocationApiTest.java @@ -64,27 +64,27 @@ public void testDocSampleGeolocation() throws Exception { .AddCellTower( new CellTower.CellTowerBuilder() .CellId(39627456) - .LocationAreaCode(40495) - .MobileCountryCode(310) - .MobileNetworkCode(260) - .Age(0) - .SignalStrength(-95) - .createCellTower()) + .LocationAreaCode(40495) + .MobileCountryCode(310) + .MobileNetworkCode(260) + .Age(0) + .SignalStrength(-95) + .createCellTower()) .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() .MacAddress("01:23:45:67:89:AB") - .SignalStrength(-65) - .SignalToNoiseRatio(8) - .Channel(8) - .Age(0) - .createWifiAccessPoint()) + .SignalStrength(-65) + .SignalToNoiseRatio(8) + .Channel(8) + .Age(0) + .createWifiAccessPoint()) .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() .MacAddress("01:23:45:67:89:AC") - .SignalStrength(4) - .SignalToNoiseRatio(4) - .Age(0) - .createWifiAccessPoint()) + .SignalStrength(4) + .SignalToNoiseRatio(4) + .Age(0) + .createWifiAccessPoint()) .CreatePayload() .await(); @@ -110,12 +110,10 @@ public void testMinimumWifiGeolocation() throws Exception { .ConsiderIp(false) .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() - .MacAddress("94:b4:0f:ff:6b:11") - .createWifiAccessPoint()) + .MacAddress("94:b4:0f:ff:6b:11").createWifiAccessPoint()) .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() - .MacAddress("94:b4:0f:ff:6b:10") - .createWifiAccessPoint()) + .MacAddress("94:b4:0f:ff:6b:10").createWifiAccessPoint()) .CreatePayload() .await(); @@ -141,15 +139,15 @@ public void testBasicGeolocation() throws Exception { .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() .MacAddress("92:68:c3:f8:76:47") - .SignalStrength(-42) - .SignalToNoiseRatio(68) - .createWifiAccessPoint()) + .SignalStrength(-42) + .SignalToNoiseRatio(68) + .createWifiAccessPoint()) .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() .MacAddress("94:b4:0f:ff:6b:11") - .SignalStrength(-55) - .SignalToNoiseRatio(55) - .createWifiAccessPoint()) + .SignalStrength(-55) + .SignalToNoiseRatio(55) + .createWifiAccessPoint()) .CreatePayload() .await(); @@ -178,12 +176,10 @@ public void testAlternateWifiSetterGeolocation() throws Exception { WifiAccessPoint[] wifiAccessPoints = new WifiAccessPoint[2]; wifiAccessPoints[0] = new WifiAccessPoint.WifiAccessPointBuilder() - .MacAddress("94:b4:0f:ff:6b:11") - .createWifiAccessPoint(); + .MacAddress("94:b4:0f:ff:6b:11").createWifiAccessPoint(); wifiAccessPoints[1] = new WifiAccessPoint.WifiAccessPointBuilder() - .MacAddress("94:b4:0f:ff:6b:10") - .createWifiAccessPoint(); + .MacAddress("94:b4:0f:ff:6b:10").createWifiAccessPoint(); GeolocationResult result = GeolocationApi.newRequest(sc.context) @@ -220,19 +216,19 @@ public void testMaximumWifiGeolocation() throws Exception { .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() .MacAddress("94:b4:0f:ff:88:31") - .SignalStrength(-61) - .SignalToNoiseRatio(49) - .Channel(40) - .Age(0) - .createWifiAccessPoint()) + .SignalStrength(-61) + .SignalToNoiseRatio(49) + .Channel(40) + .Age(0) + .createWifiAccessPoint()) .AddWifiAccessPoint( new WifiAccessPoint.WifiAccessPointBuilder() .MacAddress("94:b4:0f:ff:88:30") - .SignalStrength(-64) - .SignalToNoiseRatio(46) - .Channel(40) - .Age(0) - .createWifiAccessPoint()) + .SignalStrength(-64) + .SignalToNoiseRatio(46) + .Channel(40) + .Age(0) + .createWifiAccessPoint()) .CreatePayload() .await(); @@ -272,10 +268,10 @@ public void testMinimumCellTowerGeolocation() throws Exception { .AddCellTower( new CellTower.CellTowerBuilder() .CellId(39627456) - .LocationAreaCode(40495) - .MobileCountryCode(310) - .MobileNetworkCode(260) - .createCellTower()) + .LocationAreaCode(40495) + .MobileCountryCode(310) + .MobileNetworkCode(260) + .createCellTower()) .CreatePayload() .await(); @@ -301,14 +297,14 @@ public void testAlternatePayloadBuilderGeolocation() throws Exception { GeolocationPayload payload = new GeolocationPayload.GeolocationPayloadBuilder() .ConsiderIp(false) - .AddCellTower( - new CellTower.CellTowerBuilder() - .CellId(39627456) - .LocationAreaCode(40495) - .MobileCountryCode(310) - .MobileNetworkCode(260) - .createCellTower()) - .createGeolocationPayload(); + .AddCellTower( + new CellTower.CellTowerBuilder() + .CellId(39627456) + .LocationAreaCode(40495) + .MobileCountryCode(310) + .MobileNetworkCode(260) + .createCellTower()) + .createGeolocationPayload(); GeolocationResult result = GeolocationApi.geolocate(sc.context, payload).await(); assertNotNull(result.toString()); @@ -338,13 +334,13 @@ public void testMaximumCellTowerGeolocation() throws Exception { .AddCellTower( new CellTower.CellTowerBuilder() .CellId(39627456) - .LocationAreaCode(40495) - .MobileCountryCode(310) - .MobileNetworkCode(260) - .Age(0) - .SignalStrength(-103) - .TimingAdvance(15) - .createCellTower()) + .LocationAreaCode(40495) + .MobileCountryCode(310) + .MobileNetworkCode(260) + .Age(0) + .SignalStrength(-103) + .TimingAdvance(15) + .createCellTower()) .CreatePayload() .await(); diff --git a/src/test/java/com/google/maps/LocalTestServerContext.java b/src/test/java/com/google/maps/LocalTestServerContext.java index 5e90dde21..5f4cfff29 100644 --- a/src/test/java/com/google/maps/LocalTestServerContext.java +++ b/src/test/java/com/google/maps/LocalTestServerContext.java @@ -37,8 +37,8 @@ /** Local test mock server for unit tests. */ public class LocalTestServerContext implements AutoCloseable { - private final MockWebServer server; public final GeoApiContext context; + private final MockWebServer server; private RecordedRequest request = null; private List params = null; diff --git a/src/test/java/com/google/maps/metrics/OpenCensusTest.java b/src/test/java/com/google/maps/OpenCensusTest.java similarity index 96% rename from src/test/java/com/google/maps/metrics/OpenCensusTest.java rename to src/test/java/com/google/maps/OpenCensusTest.java index 1efc90926..281b54767 100644 --- a/src/test/java/com/google/maps/metrics/OpenCensusTest.java +++ b/src/test/java/com/google/maps/OpenCensusTest.java @@ -1,8 +1,6 @@ package com.google.maps; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import com.google.maps.internal.ApiConfig; import com.google.maps.metrics.OpenCensusMetrics; diff --git a/src/test/java/com/google/maps/PlacesApiTest.java b/src/test/java/com/google/maps/PlacesApiTest.java index 24cbbf5ca..3a762590c 100644 --- a/src/test/java/com/google/maps/PlacesApiTest.java +++ b/src/test/java/com/google/maps/PlacesApiTest.java @@ -16,35 +16,14 @@ package com.google.maps; import static com.google.maps.TestUtils.retrieveBody; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import com.google.maps.FindPlaceFromTextRequest.InputType; -import com.google.maps.FindPlaceFromTextRequest.LocationBiasCircular; -import com.google.maps.FindPlaceFromTextRequest.LocationBiasIP; -import com.google.maps.FindPlaceFromTextRequest.LocationBiasPoint; -import com.google.maps.FindPlaceFromTextRequest.LocationBiasRectangular; +import static org.junit.Assert.*; + +import com.google.maps.FindPlaceFromTextRequest.*; import com.google.maps.PlaceAutocompleteRequest.SessionToken; -import com.google.maps.model.AddressComponentType; -import com.google.maps.model.AddressType; -import com.google.maps.model.AutocompletePrediction; +import com.google.maps.model.*; import com.google.maps.model.AutocompletePrediction.MatchedSubstring; -import com.google.maps.model.AutocompleteStructuredFormatting; -import com.google.maps.model.ComponentFilter; -import com.google.maps.model.FindPlaceFromText; -import com.google.maps.model.LatLng; import com.google.maps.model.OpeningHours.Period; import com.google.maps.model.OpeningHours.Period.OpenClose.DayOfWeek; -import com.google.maps.model.Photo; -import com.google.maps.model.PlaceAutocompleteType; -import com.google.maps.model.PlaceDetails; -import com.google.maps.model.PlaceType; -import com.google.maps.model.PlacesSearchResponse; -import com.google.maps.model.PlacesSearchResult; -import com.google.maps.model.PriceLevel; -import com.google.maps.model.RankBy; import java.net.URI; import java.time.LocalTime; import java.util.Arrays; @@ -263,11 +242,21 @@ public void testPlaceDetailsLookupGoogleSydney() throws Exception { } assertNotNull(placeDetails.openingHours.weekdayText); - assertEquals(placeDetails.openingHours.weekdayText[0], "Monday: 8:30 AM – 5:30 PM"); - assertEquals(placeDetails.openingHours.weekdayText[1], "Tuesday: 8:30 AM – 5:30 PM"); - assertEquals(placeDetails.openingHours.weekdayText[2], "Wednesday: 8:30 AM – 5:30 PM"); - assertEquals(placeDetails.openingHours.weekdayText[3], "Thursday: 8:30 AM – 5:00 PM"); - assertEquals(placeDetails.openingHours.weekdayText[4], "Friday: 8:30 AM – 5:00 PM"); + assertEquals( + placeDetails.openingHours.weekdayText[0], + "Monday: 8:30\u202FAM\u2009\u2013\u20095:30\u202FPM"); + assertEquals( + placeDetails.openingHours.weekdayText[1], + "Tuesday: 8:30\u202FAM\u2009\u2013\u20095:30\u202FPM"); + assertEquals( + placeDetails.openingHours.weekdayText[2], + "Wednesday: 8:30\u202FAM\u2009\u2013\u20095:30\u202FPM"); + assertEquals( + placeDetails.openingHours.weekdayText[3], + "Thursday: 8:30\u202FAM\u2009\u2013\u20095:00\u202FPM"); + assertEquals( + placeDetails.openingHours.weekdayText[4], + "Friday: 8:30\u202FAM\u2009\u2013\u20095:00\u202FPM"); assertEquals(placeDetails.openingHours.weekdayText[5], "Saturday: Closed"); assertEquals(placeDetails.openingHours.weekdayText[6], "Sunday: Closed"); assertEquals(placeDetails.utcOffset, 660); @@ -747,7 +736,7 @@ public void testPlaceDetailsInFrench() throws Exception { assertEquals("ChIJ442GNENu5kcRGYUrvgqHw88", details.placeId); assertEquals( "35 Rue du Chevalier de la Barre, 75018 Paris, France", details.formattedAddress); - assertEquals("Sacré-Cœur", details.name); + assertEquals("Sacr\u00E9-C\u0153ur", details.name); } } diff --git a/src/test/java/com/google/maps/RoadsApiIntegrationTest.java b/src/test/java/com/google/maps/RoadsApiIntegrationTest.java index ea596a494..8789c0544 100644 --- a/src/test/java/com/google/maps/RoadsApiIntegrationTest.java +++ b/src/test/java/com/google/maps/RoadsApiIntegrationTest.java @@ -17,9 +17,7 @@ import static com.google.maps.TestUtils.retrieveBody; import static com.google.maps.internal.StringJoin.join; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import com.google.maps.model.LatLng; import com.google.maps.model.SnappedPoint; diff --git a/src/test/java/com/google/maps/StaticMapsApiTest.java b/src/test/java/com/google/maps/StaticMapsApiTest.java index bc00b3064..6cf54057f 100644 --- a/src/test/java/com/google/maps/StaticMapsApiTest.java +++ b/src/test/java/com/google/maps/StaticMapsApiTest.java @@ -40,6 +40,7 @@ public class StaticMapsApiTest { private final int HEIGHT = 480; private final LatLng MELBOURNE = new LatLng(-37.8136, 144.9630); private final LatLng SYDNEY = new LatLng(-33.8688, 151.2093); + /** This encoded path matches the exact [MELBOURNE, SYDNEY] points. */ private final String MELBOURNE_TO_SYDNEY_ENCODED_POLYLINE = "~mxeFwaxsZ_naWk~be@"; diff --git a/src/test/java/com/google/maps/TimeZoneApiTest.java b/src/test/java/com/google/maps/TimeZoneApiTest.java index cd0015c02..cfad5c233 100644 --- a/src/test/java/com/google/maps/TimeZoneApiTest.java +++ b/src/test/java/com/google/maps/TimeZoneApiTest.java @@ -15,10 +15,7 @@ package com.google.maps; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import com.google.maps.errors.ZeroResultsException; import com.google.maps.model.LatLng; diff --git a/src/test/java/com/google/maps/android/AndroidAuthenticationConfigProviderTest.java b/src/test/java/com/google/maps/android/AndroidAuthenticationConfigProviderTest.java index be44a3e40..345062849 100644 --- a/src/test/java/com/google/maps/android/AndroidAuthenticationConfigProviderTest.java +++ b/src/test/java/com/google/maps/android/AndroidAuthenticationConfigProviderTest.java @@ -1,8 +1,6 @@ package com.google.maps.android; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.mockStatic; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; import com.google.maps.SmallTests; import org.junit.Assert; diff --git a/src/test/java/com/google/maps/internal/RateLimitExecutorServiceTest.java b/src/test/java/com/google/maps/internal/RateLimitExecutorServiceTest.java index 2716fccdd..d913c9d4a 100644 --- a/src/test/java/com/google/maps/internal/RateLimitExecutorServiceTest.java +++ b/src/test/java/com/google/maps/internal/RateLimitExecutorServiceTest.java @@ -15,10 +15,7 @@ package com.google.maps.internal; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import com.google.maps.MediumTests; import java.util.AbstractMap; @@ -36,6 +33,14 @@ public class RateLimitExecutorServiceTest { private static final Logger LOG = LoggerFactory.getLogger(RateLimitExecutorServiceTest.class.getName()); + private static int countTotalRequests(AbstractMap hashMap) { + int counter = 0; + for (Integer value : hashMap.values()) { + counter += value; + } + return counter; + } + @Test public void testRateLimitDoesNotExceedSuppliedQps() throws Exception { int qps = 10; @@ -84,14 +89,6 @@ public void run() { service.shutdown(); } - private static int countTotalRequests(AbstractMap hashMap) { - int counter = 0; - for (Integer value : hashMap.values()) { - counter += value; - } - return counter; - } - @Test public void testDelayThreadIsStoppedAfterShutdownIsCalled() throws InterruptedException { RateLimitExecutorService service = new RateLimitExecutorService(); diff --git a/src/test/java/com/google/maps/internal/UrlSignerTest.java b/src/test/java/com/google/maps/internal/UrlSignerTest.java index a7c0698ef..6f72f6067 100644 --- a/src/test/java/com/google/maps/internal/UrlSignerTest.java +++ b/src/test/java/com/google/maps/internal/UrlSignerTest.java @@ -16,8 +16,7 @@ package com.google.maps.internal; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import com.google.maps.SmallTests; import java.util.ArrayList; @@ -46,12 +45,28 @@ public class UrlSignerTest { .replace('+', '-') .replace('/', '_'); + // Helper code from http://stackoverflow.com/questions/140131/ + private static byte[] hexStringToByteArray(String s) { + int len = s.length(); + byte[] data = new byte[len / 2]; + for (int i = 0; i < len; i += 2) { + data[i / 2] = + (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); + } + return data; + } + @Test public void testUrlSigner() throws Exception { UrlSigner urlSigner = new UrlSigner(SIGNING_KEY); assertEquals(SIGNATURE, urlSigner.getSignature(MESSAGE)); } + @Test + public void testUrlSignerInvalidPrivateKey() throws Exception { + assertThrows(IllegalArgumentException.class, () -> new UrlSigner("custom/Signer")); + } + @Test public void testMustSupportParallelSignatures() throws Exception { int attempts = 100; @@ -81,15 +96,4 @@ public void run() { assertTrue(fails.isEmpty()); } - - // Helper code from http://stackoverflow.com/questions/140131/ - private static byte[] hexStringToByteArray(String s) { - int len = s.length(); - byte[] data = new byte[len / 2]; - for (int i = 0; i < len; i += 2) { - data[i / 2] = - (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); - } - return data; - } } diff --git a/src/test/java/com/google/maps/model/DirectionsStepTest.java b/src/test/java/com/google/maps/model/DirectionsStepTest.java new file mode 100644 index 000000000..408b88e28 --- /dev/null +++ b/src/test/java/com/google/maps/model/DirectionsStepTest.java @@ -0,0 +1,45 @@ +package com.google.maps.model; + +import static org.junit.Assert.assertEquals; + +import java.time.ZonedDateTime; +import org.junit.Test; + +public class DirectionsStepTest { + + @Test + public void testDirectionsStepToString() { + Distance distance = new Distance(); + distance.humanReadable = "5 miles"; + distance.inMeters = 8046; + + Duration duration = new Duration(); + duration.humanReadable = "10 minutes"; + duration.inSeconds = 600; + + TransitDetails transitDetails = new TransitDetails(); + transitDetails.arrivalStop = new StopDetails(); + transitDetails.arrivalStop.location = new LatLng(37.123, -122.456); + transitDetails.arrivalStop.name = "Stop A"; + transitDetails.departureStop = new StopDetails(); + transitDetails.departureStop.location = new LatLng(37.456, -122.789); + transitDetails.departureStop.name = "Stop B"; + transitDetails.arrivalTime = ZonedDateTime.parse("2015-10-01T12:00:00-07:00"); + transitDetails.departureTime = ZonedDateTime.parse("2015-10-01T11:50:00-07:00"); + + DirectionsStep step = new DirectionsStep(); + step.htmlInstructions = "Turn left at W. 4th St."; + step.distance = distance; + step.duration = duration; + step.startLocation = new LatLng(37.123, -122.456); + step.endLocation = new LatLng(37.456, -122.789); + step.travelMode = TravelMode.DRIVING; + step.transitDetails = transitDetails; + + String expectedToString = + "[DirectionsStep: \"Turn left at W. 4th St.\" (37.12300000,-122.45600000 -> 37.45600000,-122.78900000) driving, duration=10 minutes, distance=5 miles, transitDetails=[Stop B (37.45600000,-122.78900000) at 2015-10-01T11:50-07:00 -> Stop A (37.12300000,-122.45600000) at 2015-10-01T12:00-07:00, 0 stops, headway=0 s]]"; + String actualToString = step.toString(); + + assertEquals(expectedToString, actualToString); + } +} diff --git a/src/test/java/com/google/maps/model/EnumsTest.java b/src/test/java/com/google/maps/model/EnumsTest.java index a77d85d73..b8ac33d8e 100644 --- a/src/test/java/com/google/maps/model/EnumsTest.java +++ b/src/test/java/com/google/maps/model/EnumsTest.java @@ -16,22 +16,31 @@ package com.google.maps.model; import static com.google.maps.internal.StringJoin.UrlValue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import com.google.maps.SmallTests; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import org.junit.Test; import org.junit.experimental.categories.Category; @Category(SmallTests.class) public class EnumsTest { + private static void assertCannotGetUrlValue(T unknown) { + assertNotNull(unknown); + try { + unknown.toUrlValue(); + fail("Expected to throw UnsupportedOperationException"); + } catch (UnsupportedOperationException expected) { + // Expected. + } + } + + private static List setdiff(Collection a, Collection b) { + List out = new ArrayList<>(a); + out.removeAll(b); + return out; + } + @Test public void testUnknown() throws Exception { assertNotNull(AddressComponentType.UNKNOWN); // Does not implement UrlValue. @@ -305,20 +314,4 @@ public void testCanonicalLiteralsForAddressComponentType() { addressComponentTypeToLiteralMap.size() + 1, // 1 for unknown AddressComponentType.values().length); } - - private static void assertCannotGetUrlValue(T unknown) { - assertNotNull(unknown); - try { - unknown.toUrlValue(); - fail("Expected to throw UnsupportedOperationException"); - } catch (UnsupportedOperationException expected) { - // Expected. - } - } - - private static List setdiff(Collection a, Collection b) { - List out = new ArrayList<>(a); - out.removeAll(b); - return out; - } } diff --git a/src/test/resources/com/google/maps/AutocompletePredictionStructuredFormatting.json b/src/test/resources/com/google/maps/AutocompletePredictionStructuredFormatting.json index a444a8f33..5be1fe12b 100644 --- a/src/test/resources/com/google/maps/AutocompletePredictionStructuredFormatting.json +++ b/src/test/resources/com/google/maps/AutocompletePredictionStructuredFormatting.json @@ -1,50 +1,53 @@ { - "predictions" : [ + "predictions": [ { - "description" : "1033 Princes Highway, Heathmere, Victoria, Australia", - "id" : "7416118f95efcce4c73df632b077ffbbae4998a5", - "matched_substrings" : [ + "description": "1033 Princes Highway, Heathmere, Victoria, Australia", + "id": "7416118f95efcce4c73df632b077ffbbae4998a5", + "matched_substrings": [ { - "length" : 1, - "offset" : 0 + "length": 1, + "offset": 0 } ], - "place_id" : "ChIJJS6K87yNnaoRXPN-iCJ0bJs", - "reference" : "ClRMAAAAoJx3vtMNpjfM766x_5YghMpc_zsDSWJ2qxcNWeKTvBgWanr9F4obKq_1R3lNWndCEuHjszqAnC2PjvHwCOpcKghwVDVQq9M5WK_RmwUDQZISEL2bAGMhWuyV7zML8JOdo44aFIoljjHi2IkPqQ4DQ2nGe-YBGCD9", - "structured_formatting" : { - "main_text" : "1033 Princes Highway", - "main_text_matched_substrings" : [ + "place_id": "ChIJJS6K87yNnaoRXPN-iCJ0bJs", + "reference": "ClRMAAAAoJx3vtMNpjfM766x_5YghMpc_zsDSWJ2qxcNWeKTvBgWanr9F4obKq_1R3lNWndCEuHjszqAnC2PjvHwCOpcKghwVDVQq9M5WK_RmwUDQZISEL2bAGMhWuyV7zML8JOdo44aFIoljjHi2IkPqQ4DQ2nGe-YBGCD9", + "structured_formatting": { + "main_text": "1033 Princes Highway", + "main_text_matched_substrings": [ { - "length" : 1, - "offset" : 0 + "length": 1, + "offset": 0 } ], - "secondary_text" : "Heathmere, Victoria, Australia" + "secondary_text": "Heathmere, Victoria, Australia" }, - "terms" : [ + "terms": [ { - "offset" : 0, - "value" : "1033" + "offset": 0, + "value": "1033" }, { - "offset" : 5, - "value" : "Princes Highway" + "offset": 5, + "value": "Princes Highway" }, { - "offset" : 22, - "value" : "Heathmere" + "offset": 22, + "value": "Heathmere" }, { - "offset" : 33, - "value" : "Victoria" + "offset": 33, + "value": "Victoria" }, { - "offset" : 43, - "value" : "Australia" + "offset": 43, + "value": "Australia" } ], - "types" : [ "street_address", "geocode" ] + "types": [ + "street_address", + "geocode" + ] } ], - "status" : "OK" + "status": "OK" } diff --git a/src/test/resources/com/google/maps/FindPlaceFromTextMuseumOfContemporaryArt.json b/src/test/resources/com/google/maps/FindPlaceFromTextMuseumOfContemporaryArt.json index ea7524d53..b53fbe13b 100644 --- a/src/test/resources/com/google/maps/FindPlaceFromTextMuseumOfContemporaryArt.json +++ b/src/test/resources/com/google/maps/FindPlaceFromTextMuseumOfContemporaryArt.json @@ -1,41 +1,40 @@ - { - "candidates" : [ + "candidates": [ { - "formatted_address" : "140 George St, The Rocks NSW 2000, Australia", - "geometry" : { - "location" : { - "lat" : -33.8599358, - "lng" : 151.2090295 + "formatted_address": "140 George St, The Rocks NSW 2000, Australia", + "geometry": { + "location": { + "lat": -33.8599358, + "lng": 151.2090295 }, - "viewport" : { - "northeast" : { - "lat" : -33.85824767010727, - "lng" : 151.2102470798928 + "viewport": { + "northeast": { + "lat": -33.85824767010727, + "lng": 151.2102470798928 }, - "southwest" : { - "lat" : -33.86094732989272, - "lng" : 151.2075474201073 + "southwest": { + "lat": -33.86094732989272, + "lng": 151.2075474201073 } } }, - "name" : "Museum of Contemporary Art Australia", - "opening_hours" : { - "open_now" : true, - "weekday_text" : [] + "name": "Museum of Contemporary Art Australia", + "opening_hours": { + "open_now": true, + "weekday_text": [] }, - "photos" : [ + "photos": [ { - "height" : 2268, - "html_attributions" : [ + "height": 2268, + "html_attributions": [ "\u003ca href=\"https://maps.google.com/maps/contrib/113202928073475129698/photos\"\u003eEmily Zimny\u003c/a\u003e" ], - "photo_reference" : "CmRaAAAAXBZe3QrziBst5oTCPUzL4LSgSuWYMctBNRu8bOP4TfwD0aU80YemnnbhjWdFfMX-kkh5h9NhFJky6fW5Ivk_G9fc11GekI0HOCDASZH3qRJmUBsdw0MWoCDZmwQAg-dVEhBb0aLoJXzoZ8cXWEceB9omGhRrX24jI3VnSEQUmInfYoAwSX4OPw", - "width" : 4032 + "photo_reference": "CmRaAAAAXBZe3QrziBst5oTCPUzL4LSgSuWYMctBNRu8bOP4TfwD0aU80YemnnbhjWdFfMX-kkh5h9NhFJky6fW5Ivk_G9fc11GekI0HOCDASZH3qRJmUBsdw0MWoCDZmwQAg-dVEhBb0aLoJXzoZ8cXWEceB9omGhRrX24jI3VnSEQUmInfYoAwSX4OPw", + "width": 4032 } ], - "rating" : 4.4 + "rating": 4.4 } ], - "status" : "OK" + "status": "OK" } diff --git a/src/test/resources/com/google/maps/GeocodeLibraryType.json b/src/test/resources/com/google/maps/GeocodeLibraryType.json index 8f5979e2d..363fa5596 100644 --- a/src/test/resources/com/google/maps/GeocodeLibraryType.json +++ b/src/test/resources/com/google/maps/GeocodeLibraryType.json @@ -1,75 +1,100 @@ - { - "results" : [ - { - "address_components" : [ - { - "long_name" : "3548", - "short_name" : "3548", - "types" : [ "subpremise" ] - }, - { - "long_name" : "1849", - "short_name" : "1849", - "types" : [ "street_number" ] - }, - { - "long_name" : "C Street Northwest", - "short_name" : "C St NW", - "types" : [ "route" ] - }, - { - "long_name" : "Northwest Washington", - "short_name" : "Northwest Washington", - "types" : [ "neighborhood", "political" ] - }, - { - "long_name" : "Washington", - "short_name" : "Washington", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "District of Columbia", - "short_name" : "DC", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "United States", - "short_name" : "US", - "types" : [ "country", "political" ] - }, - { - "long_name" : "20240", - "short_name" : "20240", - "types" : [ "postal_code" ] - }, - { - "long_name" : "0001", - "short_name" : "0001", - "types" : [ "postal_code_suffix" ] - } - ], - "formatted_address" : "1849 C St NW #3548, Washington, DC 20240, USA", - "geometry" : { - "location" : { - "lat" : 38.8944358, - "lng" : -77.0426044 - }, - "location_type" : "ROOFTOP", - "viewport" : { - "northeast" : { - "lat" : 38.8957847802915, - "lng" : -77.04125541970849 - }, - "southwest" : { - "lat" : 38.8930868197085, - "lng" : -77.0439533802915 - } - } + "results": [ + { + "address_components": [ + { + "long_name": "3548", + "short_name": "3548", + "types": [ + "subpremise" + ] }, - "place_id" : "ChIJi9derqW3t4kREUwRQi51e24", - "types" : [ "establishment", "library", "point_of_interest" ] - } + { + "long_name": "1849", + "short_name": "1849", + "types": [ + "street_number" + ] + }, + { + "long_name": "C Street Northwest", + "short_name": "C St NW", + "types": [ + "route" + ] + }, + { + "long_name": "Northwest Washington", + "short_name": "Northwest Washington", + "types": [ + "neighborhood", + "political" + ] + }, + { + "long_name": "Washington", + "short_name": "Washington", + "types": [ + "locality", + "political" + ] + }, + { + "long_name": "District of Columbia", + "short_name": "DC", + "types": [ + "administrative_area_level_1", + "political" + ] + }, + { + "long_name": "United States", + "short_name": "US", + "types": [ + "country", + "political" + ] + }, + { + "long_name": "20240", + "short_name": "20240", + "types": [ + "postal_code" + ] + }, + { + "long_name": "0001", + "short_name": "0001", + "types": [ + "postal_code_suffix" + ] + } + ], + "formatted_address": "1849 C St NW #3548, Washington, DC 20240, USA", + "geometry": { + "location": { + "lat": 38.8944358, + "lng": -77.0426044 + }, + "location_type": "ROOFTOP", + "viewport": { + "northeast": { + "lat": 38.8957847802915, + "lng": -77.04125541970849 + }, + "southwest": { + "lat": 38.8930868197085, + "lng": -77.0439533802915 + } + } + }, + "place_id": "ChIJi9derqW3t4kREUwRQi51e24", + "types": [ + "establishment", + "library", + "point_of_interest" + ] + } ], - "status" : "OK" + "status": "OK" }