JAVA中 fastjson判断JSONObject是否为空 

package com.map;

import com.alibaba.fastjson.JSONObject;

/**
 * 判断JSONObject是否为空 
 * @author luolei
 * @date 2019年2月14日
 */
public class FastJSONTest {

	public static void main(String[] args){
		
		JSONObject obj = new JSONObject();
		System.out.println(obj.isEmpty()); //true
		obj.put("name", "luolei");
		System.out.println(obj.isEmpty()); //false

	}
	
}

个人网站欢迎来访

http://www.leixingke.com/

GitHub 加速计划 / fastj / fastjson
3
1
下载
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
最近提交(Master分支:1 个月前 )
c942c834 - 2 年前
5bc4709b - 2 年前
Logo

新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐