com.ardoq.adapter.JsonUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-api-client Show documentation
Show all versions of java-api-client Show documentation
Java client to Ardoq public API
package com.ardoq.adapter;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.Map;
import java.util.Set;
public class JsonUtils {
/**
* Removes keys from json object if they have null values. Won't touch fields as users may want to explicitly set them to null
*
* @param jsonObject
*/
public static void removeReservedNullVaules(JsonObject jsonObject) {
Set> entries = jsonObject.entrySet();
for (Map.Entry entry : entries) {
if (entry.getValue().isJsonNull()) {
jsonObject.remove(entry.getKey());
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy