UpdateOperationUtility Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. digitaltwin. UpdateOperationUtility
- com.
public class UpdateOperationUtility
A utility to create the JSON patch payload required for update operations such as update digital twin
Method Summary
Modifier and Type | Method and Description |
---|---|
Update |
appendAddComponentOperation(String path, Map<String, Object> properties)
Include an add operation for a component. |
Update |
appendAddPropertyOperation(String path, Object value)
Include an add operation for a property. |
Update |
appendRemoveComponentOperation(String path)
Include a remove operation for a component. |
Update |
appendRemovePropertyOperation(String path)
Include a remove operation for a property. |
Update |
appendReplaceComponentOperation(String path, Map<String, Object> properties)
Include a replace operation for a component. |
Update |
appendReplacePropertyOperation(String path, Object value)
Include a replace operation for a property. |
List<Object> |
getUpdateOperations()
Gets the JSON patch payload required for update operations. |
Method Details
appendAddComponentOperation
public UpdateOperationUtility appendAddComponentOperation(String path, Map
Include an add operation for a component.
Parameters:
Returns:
The component patch should be in the following format: { "op": "add", "path": "/sampleComponentName", "value": { "samplePropertyName": 20, "$metadata": {} } }
appendAddPropertyOperation
public UpdateOperationUtility appendAddPropertyOperation(String path, Object value)
Include an add operation for a property.
Parameters:
Returns:
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 }
appendRemoveComponentOperation
public UpdateOperationUtility appendRemoveComponentOperation(String path)
Include a remove operation for a component.
Parameters:
Returns:
The patch for removing a component should be in the following format: { "op": "remove", "path": "/sampleComponentName", }
appendRemovePropertyOperation
public UpdateOperationUtility appendRemovePropertyOperation(String path)
Include a remove operation for a property.
Parameters:
Returns:
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", }
appendReplaceComponentOperation
public UpdateOperationUtility appendReplaceComponentOperation(String path, Map
Include a replace operation for a component.
Parameters:
Returns:
The component patch should be in the following format: { "op": "replace", "path": "/sampleComponentName", "value": { "samplePropertyName": 20, "$metadata": {} } }
appendReplacePropertyOperation
public UpdateOperationUtility appendReplacePropertyOperation(String path, Object value)
Include a replace operation for a property.
Parameters:
Returns:
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 }
getUpdateOperations
public List
Azure SDK for Java