Skip to content

Add typed JSON object lookup helpers find_bool_or, find_int64_or, find_uint64_or, find_double_or, and find_str_or to Value. - #255

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1013102282
Nov 9, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1013102282

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Add typed JSON object lookup helpers find_bool_or, find_int64_or, find_uint64_or, find_double_or, and find_str_or to Value.

Add concrete lookup helper methods on Value (find_bool_or, find_int64_or, find_uint64_or, find_double_or, and find_str_or) directly in Rust, following the same type naming as the as_* accessors (as_bool, as_double, as_int64, as_uint64, and as_str). They return the provided default when the receiver is not an object, the key is missing or null, or the entry cannot be represented as the target type.

@google-cla

google-cla Bot commented Nov 6, 2026

Copy link
Copy Markdown

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.

@copybara-service copybara-service Bot changed the title Add typed JSON object lookup helpers find_bool_or, find_i32_or, find_i64_or, find_u32_or, find_u64_or, find_f64_or, and find_str_or to Value. Add typed JSON object lookup helpers find_bool_or, find_int64_or, find_uint64_or, find_double_or, and find_str_or to Value. Nov 9, 2026
@copybara-service
copybara-service Bot force-pushed the test_1013102282 branch 2 times, most recently from 332e7ef to a5326a0 Compare November 9, 2026 15:58
…d_uint64_or, find_double_or, and find_str_or to Value.

Add concrete lookup helper methods on `Value` (`find_bool_or`, `find_int64_or`, `find_uint64_or`, `find_double_or`, and `find_str_or`) directly in Rust, following the same type naming as the `as_*` accessors (`as_bool`, `as_double`, `as_int64`, `as_uint64`, and `as_str`). They return the provided default when the receiver is not an object, the key is missing or null, or the entry cannot be represented as the target type.

PiperOrigin-RevId: 1017353788
@copybara-service
copybara-service Bot merged commit a79de98 into main Nov 9, 2026
2 of 3 checks passed
@copybara-service
copybara-service Bot deleted the test_1013102282 branch November 9, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants