(Scriptable object, Schema schema, int depth)
| 356 | } |
| 357 | |
| 358 | private Object jsToPigMap(Scriptable object, Schema schema, int depth) { |
| 359 | debugConvertJSToPig(depth, "Map", object, schema); |
| 360 | Map<String, Object> map = new HashMap<String, Object>(); |
| 361 | Object[] ids = object.getIds(); |
| 362 | for (Object id : ids) { |
| 363 | if (id instanceof String) { |
| 364 | String name = (String) id; |
| 365 | Object value = object.get(name, object); |
| 366 | if (value instanceof NativeJavaObject) { |
| 367 | value = ((NativeJavaObject)value).unwrap(); |
| 368 | } else if (value instanceof Undefined) { |
| 369 | value = null; |
| 370 | } |
| 371 | map.put(name, value); |
| 372 | } |
| 373 | } |
| 374 | debugReturn(depth, map); |
| 375 | return map; |
| 376 | } |
| 377 | |
| 378 | private DataBag jsToPigBag(Scriptable array, Schema schema, int depth) throws FrontendException, ExecException { |
| 379 | debugConvertJSToPig(depth, "Bag", array, schema); |
no test coverage detected