Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
327 stars 374 forks source link

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

Open pathob opened 7 years ago

pathob commented 7 years ago

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 commented 7 years ago

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.