Skip to content

Add "optional" variants -- shortValueOpt(), floatValueOpt(), asShortOpt(), asFloatOpt() #5158

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 2 commits into from
May 12, 2025

Conversation

hannyu
Copy link

@hannyu hannyu commented May 12, 2025

No description provided.

@cowtowncoder cowtowncoder added the 3.0 Issue planned for initial 3.0 release label May 12, 2025
@cowtowncoder cowtowncoder changed the title feat: Add "optional" variants -- shortValueOpt(), floatValueOpt(), asShortOpt(), asFloatOpt() Add "optional" variants -- shortValueOpt(), floatValueOpt(), asShortOpt(), asFloatOpt() May 12, 2025
@@ -227,7 +255,7 @@ public double doubleValue(double defaultValue) {
public OptionalDouble doubleValueOpt() {
double d = _asDoubleValueUnchecked();
if (Double.isFinite(d)) {
return OptionalDouble.of(_value.doubleValue());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@cowtowncoder cowtowncoder merged commit 0d89834 into FasterXML:3.x May 12, 2025
6 checks passed
@cowtowncoder
Copy link
Member

Thank you @hannyu !

@JooHyukKim JooHyukKim added the 3.0-release-notes Issues relevant for 3.0 release notes. label May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0-release-notes Issues relevant for 3.0 release notes. 3.0 Issue planned for initial 3.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants