I take data from Java to Flex by AMF (BlazeDS)
In java side object has Integer field. So it can be null.
In Flex side object is int. So null values are deserialized as 0.
This is not what I want, I want to see whether it is 0 or null.
Is there wrapper like (Integer in Java) for Flex? Thanks
We solved this by creating a BeanProxy class which overrides setValue and getValue. In there we return NaN to the flex side if the value is a Number and null, and we return null to the Java side if it's a Double and NaN. Job done:
Amarghosh has the correct answer, but you'll find as you continue through your project that life is so much easier in the amf world when you apply the "everything is a string" rule. Simply a suggestion that might help a lot in the long run.
Best of luck, Jeremy
As far as I can tell, there is no such wrapper. You can write one that assigns
NaN
to the internalint
if the argument to the constructor isnull
As Amarghosh answered, there is no such wrapper. As a workaround, we check the int value for -1 which equals an unassigned int value in our domain.