Java Json Get getJsonNumberOrNull(JsonObject object, String key)

Here you can find the source of getJsonNumberOrNull(JsonObject object, String key)

Description

get Json Number Or Null

License

Apache License

Declaration

protected static JsonNumber getJsonNumberOrNull(JsonObject object,
            String key) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.json.JsonNumber;
import javax.json.JsonObject;

public class Main {
    protected static JsonNumber getJsonNumberOrNull(JsonObject object,
            String key) {// w  w w . j  a  va 2  s.  co m
        return object.containsKey(key) && !object.isNull(key) ? object
                .getJsonNumber(key) : null;
    }
}

Related

  1. getIntArray(JsonObject object, String name)
  2. getIntegerArrayList(JsonArray array)
  3. getIntegerArrayListSansDoublons( JsonArray array)
  4. getJsonArray(JsonObject object, String name)
  5. getJsonIntArray(Iterable integers)
  6. getJsonObject(JsonObject object, String name)
  7. getJsonValue(String json_path, JsonObject response)
  8. getKeyAsString(JsonObject obj, String key, String defaultValue)
  9. getLongProperty(JsonObject object, String property)