Monday 15 September 2014

java - Groovy - collect() returning a cast exception -


I have found a very simple code snippet in which I return a list of items using the collection () of groovy I am trying to But for some reason I have trouble doing this work. In my logs I think the proper information is being retrieved:

  [[phoneNumber = 012345678, name = test]] '  

but I 'Cast Exception: The object can not be cast: The link constructor for [[phoneNumber = 012345678, name = test]]' could not be found: java.util.Iterator (java.util.LinkedHashMap) **

This is my code

  iterator & lt; Resources & gt; Children = faucet iterator & lt; Resources & gt; ServiceList = null while (serviceList.hasNext ()) {resource child = serviceList.next () child = child.collect {[phoneNumber: child.adaptTo (ValueMap.class) .get ("phoneNumber", ""), name: Child. Adetato (valemap.class) .get ("name", "")]}}   

I have not taken any advantage of using a string and resource for children Even thinking, I am belling my head for hours of editing this short.

children a list not a Ethernet

In addition, you are doing the wrong thing in your previous questions, and children just service list The last element of

No comments:

Post a Comment