node-modules / js-to-java

easy way to wrap js object to java object
MIT License
202 stars 26 forks source link

类似List<Integer>这种类型如何该如何表达 #54

Closed skyitachi closed 7 years ago

skyitachi commented 7 years ago

RT

gxcsoccer commented 7 years ago
java.List([ 1,2,3 ]);
skyitachi commented 7 years ago

这样写无法保证array里的value是java.lang.Integer啊

gxcsoccer commented 7 years ago
java.List([
  java.Integer(1),
  java.Integer(2),
  java.Integer(3)
]);
gxcsoccer commented 7 years ago

hessian.js 里会根据 number 长度来判断是 Integer 还是 Long,默认是 Integer。你要精确表达就像上面一样

skyitachi commented 7 years ago

谢了