Here you can find the source of hasKey(JsonObject object, String name)
public static boolean hasKey(JsonObject object, String name)
//package com.java2s; //License from project: Open Source License import javax.json.JsonObject; import javax.json.JsonValue; public class Main { public static boolean hasKey(JsonObject object, String name) { JsonValue value = object.get(name); if ((value == null) || (value == JsonValue.NULL)) { return false; }//www . java 2 s .c o m return true; } }