Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Should we standardize builder vs toBuilder in Datastore? #628

Closed
ajkannan opened this issue Feb 6, 2016 · 3 comments
Closed

Should we standardize builder vs toBuilder in Datastore? #628

ajkannan opened this issue Feb 6, 2016 · 3 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@ajkannan
Copy link

ajkannan commented Feb 6, 2016

This is a minor issue, but Datastore uses a static "builder" in cases that we would have a non-static "toBuilder" method in other modules. For example, in Datastore's Key, there's public static Builder builder(Key copyFrom).

Do we care about standardizing this at some point before version 1.0.0 is released?

@ajkannan ajkannan added api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue. labels Feb 6, 2016
@eamonnmcmanus
Copy link

There's a distinction between a static method that returns a Builder, conventionally called builder(), and an instance method that returns a Builder initialized with the values from the current instance, conventionally called toBuilder(). That's the convention Guava follows, at least. The method you refer to should indeed be called builder(). Do other classes not follow this convention?

@ajkannan
Copy link
Author

ajkannan commented Feb 6, 2016

The classes do indeed follow the static builder/instance toBuilder convention. I think I was unclear in my original post. I was suggesting that we replace the static builder that takes a (for example) Key object and copies the values with an instance method toBuilder that doesn't require that parameter.

@aozarov tells me that he may have tried this a while back but ran into problems, perhaps related to the inheritance hierarchy of Key and IncompleteKey. I can experiment to see if it's possible/worth it to make this change.

@ajkannan
Copy link
Author

ajkannan commented Feb 6, 2016

Indeed, because the Builder of Key doesn't extend the Builder of IncompleteKey, both IncompleteKey and Key can't have a toBuilder() method (and the same goes for Entities). Making the Builder of Key extend the Builder of IncompleteKey is painful and not worth the effort for the gain. I'll close this issue.

@ajkannan ajkannan closed this as completed Feb 6, 2016
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jun 29, 2022
github-actions bot pushed a commit that referenced this issue Aug 9, 2022
…cies to v3 (#628)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://github.com/googleapis/java-shared-dependencies) | `2.13.0` -> `3.0.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/compatibility-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/confidence-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-shared-dependencies</summary>

### [`v3.0.1`](https://github.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#&#8203;301-httpsgithubcomgoogleapisjava-shared-dependenciescomparev300v301-2022-08-02)

[Compare Source](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.0...v3.0.1)

##### Dependencies

-   update dependency com.google.code.gson:gson to v2.9.1 ([#&#8203;766](https://github.com/googleapis/java-shared-dependencies/issues/766)) ([f7b2b06](https://github.com/googleapis/java-shared-dependencies/commit/f7b2b06b80e3e95ff8ab9b1d6a2638ef3069298a))
-   update gax.version to v2.18.7 ([#&#8203;767](https://github.com/googleapis/java-shared-dependencies/issues/767)) ([9650368](https://github.com/googleapis/java-shared-dependencies/commit/96503682e98cdf348ea2c1365a03a60f4322c712))
-   update google.core.version to v2.8.6 ([#&#8203;770](https://github.com/googleapis/java-shared-dependencies/issues/770)) ([cfd4377](https://github.com/googleapis/java-shared-dependencies/commit/cfd4377dc178cebb4724065d55d185ce03988d55))

### [`v3.0.0`](https://github.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#&#8203;300-httpsgithubcomgoogleapisjava-shared-dependenciescomparev2130v300-2022-07-29)

[Compare Source](https://github.com/googleapis/java-shared-dependencies/compare/v2.13.0...v3.0.0)

##### Bug Fixes

-   enable longpaths support for windows test ([#&#8203;1485](https://github.com/googleapis/java-shared-dependencies/issues/1485)) ([#&#8203;738](https://github.com/googleapis/java-shared-dependencies/issues/738)) ([11bc8f8](https://github.com/googleapis/java-shared-dependencies/commit/11bc8f81f28be88a97fdeafca21724e33638770c))

##### Dependencies

-   update dependency com.google.api-client:google-api-client-bom to v1.35.2 ([#&#8203;729](https://github.com/googleapis/java-shared-dependencies/issues/729)) ([1fa59af](https://github.com/googleapis/java-shared-dependencies/commit/1fa59af80abb9f278f57658c10158567e825fec6))
-   update dependency com.google.api-client:google-api-client-bom to v2 ([#&#8203;746](https://github.com/googleapis/java-shared-dependencies/issues/746)) ([2dcb2e0](https://github.com/googleapis/java-shared-dependencies/commit/2dcb2e071e0ba0eea21bb575bd13cd559d4a1ca6))
-   update dependency com.google.api.grpc:grpc-google-common-protos to v2.9.2 ([#&#8203;741](https://github.com/googleapis/java-shared-dependencies/issues/741)) ([3352d6c](https://github.com/googleapis/java-shared-dependencies/commit/3352d6c36111c04e3f6f3e6360470fa3efb10d8f))
-   update dependency com.google.auth:google-auth-library-bom to v1.8.0 ([#&#8203;726](https://github.com/googleapis/java-shared-dependencies/issues/726)) ([2c5d64c](https://github.com/googleapis/java-shared-dependencies/commit/2c5d64c127db8384e49113acfeac6928716a2d7f))
-   update dependency com.google.auth:google-auth-library-bom to v1.8.1 ([#&#8203;742](https://github.com/googleapis/java-shared-dependencies/issues/742)) ([4f53527](https://github.com/googleapis/java-shared-dependencies/commit/4f53527bda7f40896711b7c1d1c02453321ffbc8))
-   update dependency com.google.cloud:first-party-dependencies to v2 ([#&#8203;747](https://github.com/googleapis/java-shared-dependencies/issues/747)) ([e970ac0](https://github.com/googleapis/java-shared-dependencies/commit/e970ac0599941c825dc2516146a7c6673e68a9b9))
-   update dependency com.google.cloud:grpc-gcp to v1.2.1 ([#&#8203;751](https://github.com/googleapis/java-shared-dependencies/issues/751)) ([b3284b6](https://github.com/googleapis/java-shared-dependencies/commit/b3284b6ee52a96a6ea8696a05a94443df9ee5b9f))
-   update dependency com.google.cloud:third-party-dependencies to v2 ([#&#8203;748](https://github.com/googleapis/java-shared-dependencies/issues/748)) ([573b41a](https://github.com/googleapis/java-shared-dependencies/commit/573b41a69504372741cbeb01dd200e7c71967186))
-   update dependency com.google.http-client:google-http-client-bom to v1.42.1 ([#&#8203;730](https://github.com/googleapis/java-shared-dependencies/issues/730)) ([6b47126](https://github.com/googleapis/java-shared-dependencies/commit/6b47126686b603a5d112e097ce6aa3a1880daf6f))
-   update dependency com.google.http-client:google-http-client-bom to v1.42.2 ([#&#8203;749](https://github.com/googleapis/java-shared-dependencies/issues/749)) ([299d7b0](https://github.com/googleapis/java-shared-dependencies/commit/299d7b0d4920644e2c3070d12dd1d97da17a5e88))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.2 ([#&#8203;722](https://github.com/googleapis/java-shared-dependencies/issues/722)) ([7a96b12](https://github.com/googleapis/java-shared-dependencies/commit/7a96b1259a526b63e9376fd6cc18b27cddeb5f0f))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.3 ([#&#8203;756](https://github.com/googleapis/java-shared-dependencies/issues/756)) ([3d0bac2](https://github.com/googleapis/java-shared-dependencies/commit/3d0bac23487aebb94267c0708f41ff6c02a028a4))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.4 ([#&#8203;759](https://github.com/googleapis/java-shared-dependencies/issues/759)) ([5a54ef1](https://github.com/googleapis/java-shared-dependencies/commit/5a54ef1a2d56244166d4fcc46041d62c0dc4b411))
-   update dependency io.grpc:grpc-bom to v1.48.0 ([#&#8203;752](https://github.com/googleapis/java-shared-dependencies/issues/752)) ([20ac908](https://github.com/googleapis/java-shared-dependencies/commit/20ac908932a5e7c8e581bdfcd68579d7e1cedd5f))
-   update dependency org.checkerframework:checker-qual to v3.23.0 ([#&#8203;736](https://github.com/googleapis/java-shared-dependencies/issues/736)) ([fc01d8f](https://github.com/googleapis/java-shared-dependencies/commit/fc01d8f93f391f12fdb800d5006f0b4505832eeb))
-   update gax.version to v2.18.3 ([#&#8203;731](https://github.com/googleapis/java-shared-dependencies/issues/731)) ([e8ee554](https://github.com/googleapis/java-shared-dependencies/commit/e8ee554707acb2f71c739d08e2ff02fbe43ffa52))
-   update gax.version to v2.18.4 ([#&#8203;735](https://github.com/googleapis/java-shared-dependencies/issues/735)) ([11c7415](https://github.com/googleapis/java-shared-dependencies/commit/11c74152a84697924de3a0e838b05f606c3098f7))
-   update gax.version to v2.18.5 ([#&#8203;758](https://github.com/googleapis/java-shared-dependencies/issues/758)) ([7469fc1](https://github.com/googleapis/java-shared-dependencies/commit/7469fc1cc5095b39a5738e60156711a268f6e052))
-   update gax.version to v2.18.6 ([#&#8203;763](https://github.com/googleapis/java-shared-dependencies/issues/763)) ([b5ca2f7](https://github.com/googleapis/java-shared-dependencies/commit/b5ca2f7b4d81c705823253f4f03363a32d2be48b))
-   update google.common-protos.version to v2.9.1 ([#&#8203;724](https://github.com/googleapis/java-shared-dependencies/issues/724)) ([5213dbb](https://github.com/googleapis/java-shared-dependencies/commit/5213dbbfa9c9b73d2420ec2be7782f16c9c4955f))
-   update google.core.version to v2.8.1 ([#&#8203;725](https://github.com/googleapis/java-shared-dependencies/issues/725)) ([575858a](https://github.com/googleapis/java-shared-dependencies/commit/575858a60f76e46bbc2a2435c2b6c01c8f4ab681))
-   update google.core.version to v2.8.3 ([#&#8203;760](https://github.com/googleapis/java-shared-dependencies/issues/760)) ([cb10ae4](https://github.com/googleapis/java-shared-dependencies/commit/cb10ae4b76939215ea465af74163b3d4ad65a548))
-   update google.core.version to v2.8.4 ([#&#8203;762](https://github.com/googleapis/java-shared-dependencies/issues/762)) ([821daaf](https://github.com/googleapis/java-shared-dependencies/commit/821daafefdbcfdfe6e363e580747538096a562ef))
-   update google.core.version to v2.8.5 ([#&#8203;764](https://github.com/googleapis/java-shared-dependencies/issues/764)) ([a1f8f50](https://github.com/googleapis/java-shared-dependencies/commit/a1f8f501b54143a2cec8e72efd4ceb3ce47f13ae))
-   update iam.version to v1.5.0 ([#&#8203;732](https://github.com/googleapis/java-shared-dependencies/issues/732)) ([9dce0e5](https://github.com/googleapis/java-shared-dependencies/commit/9dce0e5199c1e425119adc804304958f58003a27))
-   update iam.version to v1.5.1 ([#&#8203;737](https://github.com/googleapis/java-shared-dependencies/issues/737)) ([df39168](https://github.com/googleapis/java-shared-dependencies/commit/df391685d42fcb1b04f03ab1380a594893bdce37))
-   update iam.version to v1.5.2 ([#&#8203;743](https://github.com/googleapis/java-shared-dependencies/issues/743)) ([cdde697](https://github.com/googleapis/java-shared-dependencies/commit/cdde697f25a89fc8c2ec7eae6b7c54f69977bb1c))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-monitoring-dashboards).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMjcuNCIsInVwZGF0ZWRJblZlciI6IjMyLjEzNS4xIn0=-->
github-actions bot pushed a commit that referenced this issue Aug 9, 2022
🤖 I have created a release *beep* *boop*
---


## [2.5.2](googleapis/java-monitoring-dashboards@v2.5.1...v2.5.2) (2022-08-09)


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#628](googleapis/java-monitoring-dashboards#628)) ([08ec2b8](googleapis/java-monitoring-dashboards@08ec2b8))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants