小编Tej*_*ani的帖子

Jackson:使用jackson将json字符串响应转换为pojo转换时过滤空值或空值

我正在使用杰克逊将杰森的回应转换为pojo列表.以下是我得到的回复.

[

    {
        "code": "",
        "total": 24,
        "name": null
    },
    {
        "code": "",
        "total": 1,
        "name": "Test"
    }
]
Run Code Online (Sandbox Code Playgroud)

我正在将它转换为Pojo列表.下面是我的pojo.

public class ItemCategory {

private String code;
private String name;
private String total;

public ItemCategory() {
}

public ItemCategory(final String code, final String name, final String total) {
    super();
    this.code = code;
    this.name = name;
    this.total = total;
}

/**
 * @return the code
 */
public String getCode() {
    return code;
}

/**
 * @param code
 *            the code to …
Run Code Online (Sandbox Code Playgroud)

json pojo liferay jackson liferay-6

3
推荐指数
1
解决办法
5247
查看次数

标签 统计

jackson ×1

json ×1

liferay ×1

liferay-6 ×1

pojo ×1