public class JSONMergeUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JSONMergeUtils.ConflictStrategy |
| Constructor and Description |
|---|
JSONMergeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
count(com.google.gson.JsonArray array,
com.google.gson.JsonElement element)
Count given elements in array.
|
static void |
extendJSONObject(com.google.gson.JsonObject destinationObject,
JSONMergeUtils.ConflictStrategy conflictResolutionStrategy,
com.google.gson.JsonObject... jsonObjects)
Extends a particular JSON Object by merging multiple objects under a given conflict resolution strategy.
|
static com.google.gson.JsonObject |
extendJSONObject(com.google.gson.JsonObject sourceObj,
com.google.gson.JsonObject targetObj)
Merges a source JSON object into a target JSON object.
|
static com.google.gson.JsonArray |
getJsonArray(String jsonString)
Convert a string to JSON Array.
|
static com.google.gson.JsonObject |
getJsonObject(String jsonString)
Creates a JSON object from a string.
|
public static void extendJSONObject(com.google.gson.JsonObject destinationObject,
JSONMergeUtils.ConflictStrategy conflictResolutionStrategy,
com.google.gson.JsonObject... jsonObjects)
throws JSONObjectExtensionException
destinationObject - Destination JSON Object.conflictResolutionStrategy - Conflict resolution strategy.jsonObjects - JSON Objects to be merged.JSONObjectExtensionExceptionpublic static com.google.gson.JsonObject extendJSONObject(com.google.gson.JsonObject sourceObj,
com.google.gson.JsonObject targetObj)
sourceObj - Source JSON Object.targetObj - Target JSON Object.UnsupportedOperationExceptionpublic static com.google.gson.JsonObject getJsonObject(String jsonString)
jsonString - JSON object as a string.public static com.google.gson.JsonArray getJsonArray(String jsonString)
jsonString - JSON array as string.public static int count(com.google.gson.JsonArray array,
com.google.gson.JsonElement element)
element - Element to find.Copyright © 2005–2024 Apache Software Foundation. All rights reserved.