I have an scala List like this:
List((List("android..", "android.webkit.*", "android.webkit.WebView"),List("void setInt (int), 20", "boolean deleteCache (android.content.Context), 20")))
From the above List I need something like the following (Nested Mapping):
List(
Map(
"name" -> "android.*.*",
"children" -> List(
Map(
"name" -> "android.webkit.*",
"children" -> List(
Map(
"name" -> "android.webkit.WebView",
"children" -> List(
Map("name" -> "void setInt (int)", "value" -> 20),
Map("name" -> "boolean deleteCache (android.content.Context)", "value" -> 20)
)
)
)
)
)
)
)
I have tried with List "head" and "tail" along with a recursive approach. However, I didn't get the best out of it.
Any kinds of hints will be a great help for me. Thanks in advance.