-
The goal here is to create a node with a child questionSet and two questions within that questionSet. But I am unable to add the metaData of the children nodes into parent metaData as an array of "children". Getting the error "Cannot resolve overloaded method 'add'".
Code blocks with the said issue:
getNode() function returns a node with basic fields and has the prototype:
What is the correct way to create this node? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It was a type casting error. Node.getMetadata() returns a Map of type util.Map[String, AnyRef] but I had specified util.HashMap[String, AnyRef] as the type for elements in the ArrayList. The fix would simply be to change the expected type to Map. Like:
|
Beta Was this translation helpful? Give feedback.
It was a type casting error. Node.getMetadata() returns a Map of type util.Map[String, AnyRef] but I had specified util.HashMap[String, AnyRef] as the type for elements in the ArrayList. The fix would simply be to change the expected type to Map.
Like:
For posterity, the refactored function with the above fix would be: