阿里巴巴json fastjson String转javaBean

private Entity getEntity(String resp){
        JSONObject jsonObj = (JSONObject) JSON.parse(resp);
        if (jsonObj.getJSONArray("data") != null) {
            jsonObj = jsonObj.getJSONArray("data").getJSONObject(0);
        }
        jsonObj.remove("******");
        Entity entity= JSONObject.toJavaObject(jsonObj,Entity.class);
        return entity;
    }

转好了。

原文地址:https://www.cnblogs.com/yidiandhappy/p/6702456.html