Update Java prop casting

Summary: Updates the casting for Java props

Reviewed By: JoshuaGross

Differential Revision: D16417805

fbshipit-source-id: 7881ff984527555a4905b62d83751ed2a43b1070
This commit is contained in:
Rick Hanlon
2019-07-24 10:36:24 -07:00
committed by Facebook Github Bot
parent 58d3cb2fff
commit 34505dba05
2 changed files with 15 additions and 15 deletions
@@ -44,13 +44,13 @@ function getJavaValueForProp(
case 'StringTypeAnnotation':
return '(String) value';
case 'Int32TypeAnnotation':
return '(int) value';
return '((Double) value).intValue()';
case 'FloatTypeAnnotation':
return '(Float) value';
return '((Double) value).floatValue()';
case 'NativePrimitiveTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return '(Integer) value';
return '((Double) value).intValue()';
case 'ImageSourcePrimitive':
return '(ReadableMap) value';
case 'PointPrimitive':