public class JSONMergeUtils
extends java.lang.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(java.lang.String jsonString)
Convert a string to JSON Array.
|
static com.google.gson.JsonObject |
getJsonObject(java.lang.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.JSONObjectExtensionException
public static com.google.gson.JsonObject extendJSONObject(com.google.gson.JsonObject sourceObj, com.google.gson.JsonObject targetObj)
sourceObj
- Source JSON Object.targetObj
- Target JSON Object.java.lang.UnsupportedOperationException
public static com.google.gson.JsonObject getJsonObject(java.lang.String jsonString)
jsonString
- JSON object as a string.public static com.google.gson.JsonArray getJsonArray(java.lang.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-2021 Apache Software Foundation. All Rights Reserved.