Kotlin编辑JsonObject使用iterator

2020-06-06  本文已影响0人  hao_developer
val skuPropsJson = JSON.parseObject(skuProps)
val specDatas = arrayListOf<SpecBean>()
val iter = skuPropsJson.entries.iterator()
while (iter.hasNext()){
         val entry = iter.next() as Map.Entry<String,String>
         specDatas.add(SpecBean().apply {
         specKey = entry.key
         specValue = entry.value
          })
}
上一篇下一篇

猜你喜欢

热点阅读