public class CosmosUtils extends Object
| Constructor and Description |
|---|
CosmosUtils() |
| Modifier and Type | Method and Description |
|---|---|
static PartitionKey |
createPartitionKey(com.fasterxml.jackson.databind.JsonNode jsonNode,
CosmosEntityInformation<?,?> entityInfo)
Creates partition key from json node by converting the jsonNode type to appropriate Java type.
|
static <T> void |
fillAndProcessResponseDiagnostics(ResponseDiagnosticsProcessor responseDiagnosticsProcessor,
CosmosDiagnostics cosmosDiagnostics,
FeedResponse<T> feedResponse)
Generate ResponseDiagnostics with cosmos and feed response diagnostics
|
static String |
getStringIDValue(Object idValue)
ID value should be string value, real id type will be String, Integer, Long,
all of these must be converted to String type.
|
public static <T> void fillAndProcessResponseDiagnostics(ResponseDiagnosticsProcessor responseDiagnosticsProcessor, CosmosDiagnostics cosmosDiagnostics, FeedResponse<T> feedResponse)
T - type of cosmosResponseresponseDiagnosticsProcessor - collect Response Diagnostics from API responses and then set in ResponseDiagnostics object.cosmosDiagnostics - response from cosmosfeedResponse - response from feedpublic static String getStringIDValue(Object idValue)
idValue - id value to findIllegalArgumentException - thrown if id value fail the validation.IllegalQueryException - thrown if id value fail the validation.public static PartitionKey createPartitionKey(com.fasterxml.jackson.databind.JsonNode jsonNode, CosmosEntityInformation<?,?> entityInfo)
jsonNode - jsonNode domain objectentityInfo - entityInfo for the domainTypeCopyright © 2020 Microsoft Corporation. All rights reserved.