MCPcopy Create free account
hub / github.com/FongMi/TV / isEmpty

Method isEmpty

catvod/src/main/java/com/github/catvod/utils/Json.java:47–54  ·  view source on GitHub ↗
(JsonObject obj, String key)

Source from the content-addressed store, hash-verified

45 }
46
47 public static boolean isEmpty(JsonObject obj, String key) {
48 if (!obj.has(key)) return true;
49 JsonElement element = obj.get(key);
50 if (element.isJsonNull()) return true;
51 if (element.isJsonArray()) return element.getAsJsonArray().isEmpty();
52 if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isString()) return element.getAsString().trim().isEmpty();
53 return true;
54 }
55
56 public static String safeString(JsonObject obj, String key) {
57 try {

Callers 15

initLiveMethod · 0.95
initWallMethod · 0.95
extractAssetsMethod · 0.45
isObjMethod · 0.45
isArrayMethod · 0.45
toMapMethod · 0.45
digestResponseMethod · 0.45
buildHeaderMethod · 0.45
selectQopMethod · 0.45
md5Method · 0.45
getIpMethod · 0.45
getHostAddressMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected