代码实例:
val js = """[
| {
| "aa": "1437916748690784257",
| "type": 5,
| "priority": 1,
| "feature": "lpOk...",
| "channelId": "Fw61LVxMA1BHNH5LGSCPPF",
| "capTime": 111
| },
| {
| "aa": "1436039428711424001",
| "type": 8,
| "priority": 0,
| "feature": "lpOkPQ...",
| "channelId": "Fw61LVxMA1BHNH5LGSCPPF",
| "capTime": 222
| }
| ]""".stripMargin
val array = JSON.parseArray(js,classOf[JSONObject])
import scala.collection.JavaConverters._
val longs = array.asScala.map(x => x.getLong("capTime")).max
println(longs)