-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
add asShort()
, asFloat()
conversion methods with tests
#5138
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
Conversation
@@ -111,11 +111,6 @@ protected String _asString() { | |||
return _value ? "true" : "false"; | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
@@ -55,6 +60,9 @@ public final boolean canConvertToExactIntegral() { | |||
@Override | |||
public final short shortValue() { | |||
if (!_inShortRange()) { | |||
if (isNaN()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good! Approved as-is.
Excellent, thank you @hannyu! If you want, it'd be possible to, as follow-up:
but this is very good addition already. |
asShort()
, asFloat()
conversion methods with tests
@cowtowncoder Very glad to contribute! Here’s what I think:
|
Right, for Optional- and Atomic- there's just Int/Long/Double by JDK. So yes, Thank you very much again for working on these! |
feat: complete type conversion support