Flex空整数 [英] Flex Null Integer

查看:140
本文介绍了Flex空整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Java到Flex的数据由AMF(BlazeDS)

在java中,side对象有Integer字段。所以它可以为空。



在Flex中,side对象是int。所以空值被反序列化为0。



这不是我想要的,我想看看它是0还是null。

Flex中是否有像(Integer in Java)的包装?
谢谢

解决方案

据我所知,没有这样的包装。如果构造函数的参数是,那么你可以编写一个指定 NaN 给内部 int null


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

解决方案

As far as I can tell, there is no such wrapper. You can write one that assigns NaN to the internal int if the argument to the constructor is null

这篇关于Flex空整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆