public final class UpdateOperationUtility extends Object
| Constructor and Description |
|---|
UpdateOperationUtility() |
| Modifier and Type | Method and Description |
|---|---|
UpdateOperationUtility |
appendAddComponentOperation(String path,
Map<String,Object> properties)
Include an add operation for a component.
|
UpdateOperationUtility |
appendAddPropertyOperation(String path,
Object value)
Include an add operation for a property.
|
UpdateOperationUtility |
appendRemoveComponentOperation(String path)
Include a remove operation for a component.
|
UpdateOperationUtility |
appendRemovePropertyOperation(String path)
Include a remove operation for a property.
|
UpdateOperationUtility |
appendReplaceComponentOperation(String path,
Map<String,Object> properties)
Include a replace operation for a component.
|
UpdateOperationUtility |
appendReplacePropertyOperation(String path,
Object value)
Include a replace operation for a property.
|
List<Object> |
getUpdateOperations()
Gets the JSON patch payload required for update operations.
|
public List<Object> getUpdateOperations()
public UpdateOperationUtility appendAddPropertyOperation(String path, Object value)
path - The path to the property to be added.value - The value to update to.
The root-level property patch should be in the following format:
{
"op": "add",
"path": "/samplePropertyName",
"value": 20
}
The component-level property patch should be in the following format:
{
"op": "add",
"path": "/sampleComponentName/samplePropertyName",
"value": 20
}
public UpdateOperationUtility appendAddComponentOperation(String path, Map<String,Object> properties)
path - The path to the component to be added.properties - A collection of properties and their values in the component.
The component patch should be in the following format:
{
"op": "add",
"path": "/sampleComponentName",
"value": {
"samplePropertyName": 20,
"$metadata": {}
}
}
public UpdateOperationUtility appendReplacePropertyOperation(String path, Object value)
path - The path to the property to be updated.value - The value to update to.
The root-level property patch should be in the following format:
{
"op": "replace",
"path": "/samplePropertyName",
"value": 20
}
The root-level property patch should be in the following format:
{
"op": "replace",
"path": "/sampleComponentName/samplePropertyName",
"value": 20
}
public UpdateOperationUtility appendReplaceComponentOperation(String path, Map<String,Object> properties)
path - The path to the component to be updated.properties - A collection of properties and their values in the component.
The component patch should be in the following format:
{
"op": "replace",
"path": "/sampleComponentName",
"value": {
"samplePropertyName": 20,
"$metadata": {}
}
}
public UpdateOperationUtility appendRemovePropertyOperation(String path)
path - The path to the property to be added.
The patch for removing a root-level property should be in the following format:
{
"op": "remove",
"path": "/samplePropertyName",
}
The patch for removing a component-level property should be in the following format:
{
"op": "remove",
"path": "/sampleComponentName/samplePropertyName",
}
public UpdateOperationUtility appendRemoveComponentOperation(String path)
path - The path to the component to be removed.
The patch for removing a component should be in the following format:
{
"op": "remove",
"path": "/sampleComponentName",
}
Copyright © 2024. All rights reserved.