Added Generic getNumber Method to AggregationResult by st4sik · Pull Request #1861 · googleapis/java-datastore · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Added Generic getNumber Method to AggregationResult #1861

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025

Conversation

st4sik
Copy link
Contributor

@st4sik st4sik commented May 19, 2025

feat: add getNumber to AggregationResult (#1851)

@st4sik st4sik requested review from a team as code owners May 19, 2025 15:12
Copy link

google-cla bot commented May 19, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: datastore Issues related to the googleapis/java-datastore API. labels May 19, 2025
@st4sik st4sik force-pushed the aggregation-getnumber branch 4 times, most recently from cfefabd to 388905c Compare May 19, 2025 15:38
@cindy-peng
Copy link
Contributor

/gcbrun

@st4sik st4sik force-pushed the aggregation-getnumber branch from 388905c to 7921e73 Compare May 27, 2025 19:29
@st4sik st4sik force-pushed the aggregation-getnumber branch from 7921e73 to 0175a42 Compare May 27, 2025 19:33
@st4sik
Copy link
Contributor Author

st4sik commented May 27, 2025

@cindy-peng
I didn't explicitly write 50L in the test because the method integralValue in com.google.common.truth.Subject already handles the conversion.

Here's the relevant code:

private static long integralValue(Object o) {
        if (o instanceof Character) {
            return (long)(Character)o;
        } else if (o instanceof Number) {
            return ((Number)o).longValue();
        } else {
            throw new AssertionError(o + " must be either a Character or a Number.");
        }
    }

As you can see, if the input is a Number, it automatically gets converted to long using longValue().
So even if I pass 50 (an Integer), it will be treated as 50L internally.

@cindy-peng
Copy link
Contributor

/gcbrun

@cindy-peng cindy-peng added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 28, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 28, 2025
@cindy-peng cindy-peng merged commit b9c2c3f into googleapis:main May 29, 2025
21 checks passed
@st4sik
Copy link
Contributor Author

st4sik commented May 29, 2025

@cindy-peng

thanks a lot.

svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Jun 6, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
|
[com.google.cloud:google-cloud-logging](https://github.com/googleapis/java-logging)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`3.22.4` -> `3.22.5` |
|
[com.google.cloud:google-cloud-datastore](https://github.com/googleapis/java-datastore)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`2.28.2` -> `2.29.0` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.57` -> `2.31.58` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.57` -> `2.31.58` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.57` -> `2.31.58` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.57` -> `2.31.58` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.57` -> `2.31.58` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.57` -> `2.31.58` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.57` -> `2.31.58` |

---

### Release Notes

<details>
<summary>googleapis/java-logging
(com.google.cloud:google-cloud-logging)</summary>

###
[`v3.22.5`](https://github.com/googleapis/java-logging/blob/HEAD/CHANGELOG.md#3225-2025-06-05)

##### Bug Fixes

- **deps:** Update the Java code generator (gapic-generator-java) to
2.59.0
([f2362fb](googleapis/java-logging@f2362fb))

##### Dependencies

- Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0
([#&#8203;1813](googleapis/java-logging#1813))
([c15da84](googleapis/java-logging@c15da84))

</details>

<details>
<summary>googleapis/java-datastore
(com.google.cloud:google-cloud-datastore)</summary>

###
[`v2.29.0`](https://github.com/googleapis/java-datastore/blob/HEAD/CHANGELOG.md#2290-2025-06-06)

##### Features

- Add getNumber to AggregationResult
(googleapis/java-datastore#1851)
([#&#8203;1861](googleapis/java-datastore#1861))
([b9c2c3f](googleapis/java-datastore@b9c2c3f))

##### Bug Fixes

- Remove 500 char path name limit
([#&#8203;1865](googleapis/java-datastore#1865))
([1097175](googleapis/java-datastore@1097175))

##### Dependencies

- Update dependency org.easymock:easymock to v5.6.0
([#&#8203;1858](googleapis/java-datastore#1858))
([acc1513](googleapis/java-datastore@acc1513))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

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

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: f1129aae97972eef0c4a3934c7b16fad67f6547d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/java-datastore API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.