Skip to content
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

[IMP] Add getter for floats and avoid NullPointerExceptions in OValues #329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pathob
Copy link

@pathob pathob commented Jul 4, 2017

As OValues are closely related to ODataRecords which are using float values,
there should also be a getter for float values for OValues.

As all getters in OValues were using the wrapper classes for the primitive data
types, this commit also changes the return type for long values to 'Long'.

Until now, a NullPointerException has been thrown if someone tried to use the
typed getters in OValues for non-existant keys. This has been changed as well.
Instead, the methods are returning the same value as if the value of the field
would have been 'false'.

As OValues are closely related to ODataRecords which are using float values,
there should also be a getter for float values for OValues.

As all getters in OValues were using the wrapper classes for the primitive data
types, this commit also changes the return type for long values to 'Long'.

Until now, a NullPointerException has been thrown if someone tried to use the
typed getters in OValues for non-existant keys. This has been changed as well.
Instead, the methods are returning the same value as if the value of the field
would have been 'false'.
@pathob
Copy link
Author

pathob commented Jul 4, 2017

Another suggestion. As we are already returning the wrapper classes Integer, Float etc. it would probably make more sense to return "null" if the value is 'false' or the key does not exist.

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.

1 participant