我有一个LinkedTree
这样的人
PlayResponseListPlayDTO allResponsePlays = getPlayOfferListForCustomer(request);
我得到这样的Arraylist
:
ArrayList<LinkedTreeMap<String, Object>> orgs = (ArrayList<LinkedTreeMap<String, Object>>) allResponsePlays
.getResult();
我遍历它:
for (LinkedTreeMap<String, Object> singleOrg : orgs) {
当我像这样获得jsonarray
作为字符串时:
String formattedProductConditionStr = singleOrg.get(FORMATTED_PRODUCT_CONDITION)
.toString();
就是这样,它有2个元素:
[{"subCondition":"default","minGuaranteeRate":"15"}
{"subCondition":"nonGo","minGuaranteeRate":"16"}
]
我想向其中之一添加元素,我在最后一个元素中添加了maxRate
:
[{"subCondition":"default","minGuaranteeRate":"15"}
{"subCondition":"nonGo","minGuaranteeRate":"16", "maxRate":13}
]
如何通过一些Json
操作添加它?当前,我正在使用string builder
操作,并不安全