有一些数据的字符串表示:
"jsonData": {
"data1": {
"field1": "data1",
"field2": 1.0,
"field3": true
},
"data211": {
"field1": "data211",
"field2": 4343.0,
"field3": false
},
"data344": {
"field1": "data344",
"field2": 436778.51,
"field3": true
},
"data41": {
"field1": "data41",
"field2": 14348.0,
"field3": true
}
}
我如何在 Scala 中表示它?我以为我可以
Map[(String, Double, Boolean), String]
或者
type KeyValueType = (String, Double, Boolean)
Map[KeyValueType, String]
但是,它给了我错误:
error: missing arguments for method apply in class GenMapFactory;
follow this method with `_' if you want to treat it as a partially applied function
而且,我不确定它是否是正确的代表。
那么我该如何表示它,如果我的方法是正确的,我该如何摆脱错误呢?