将元素添加到ArrayList <linkedtreemap <string,object =“” >>的底部

时间:2018-12-10 13:03:32

标签: arrays json

我有一个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操作,并不安全

0 个答案:

没有答案