Java Json hasKey(JsonObject object, String name)

Here you can find the source of hasKey(JsonObject object, String name)

Description

has Key

License

Open Source License

Declaration

public static boolean hasKey(JsonObject object, String name) 

Method Source Code

//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;
    }
}

Related

  1. fromDictionary(Map dictionary)
  2. getAsJSONArray(Object obj)
  3. getFromGson(String json, Class clazz)
  4. getJSONDate(long l)
  5. getJsonMapper()
  6. jsonEquals(JsonArray expected, JsonArray actual, boolean strict)
  7. jsonObject(String key, JsonValue val)
  8. jsonObjectToBuilder(JsonObject jo)
  9. jsonPrettyPrinter(Object object)