Class JsonUtils


  • public final class JsonUtils
    extends Object
    • Constructor Detail

      • JsonUtils

        public JsonUtils()
    • Method Detail

      • orEmptyDocument

        public static com.azure.cosmos.implementation.Document orEmptyDocument​(String json)
      • orEmptySqlQuerySpec

        public static com.azure.cosmos.models.SqlQuerySpec orEmptySqlQuerySpec​(String json)
        Deserialize the json to query parameters.
        Parameters:
        json - the query parameters in json format. See request body: https://docs.microsoft.com/en-us/rest/api/cosmos-db/query-documents.
        Returns:
        the SqlQuerySpec.
      • orEmptyStoredProcedureProperties

        public static com.azure.cosmos.models.CosmosStoredProcedureProperties orEmptyStoredProcedureProperties​(String json)
        Deserialize the json to Stored Procedure parameters.
        Parameters:
        json - the Stored Procedure in json format. See request body: https://docs.microsoft.com/en-us/rest/api/cosmos-db/create-a-stored-procedure.
        Returns:
        the CosmosStoredProcedureProperties.
      • mergeDocuments

        public static com.azure.cosmos.implementation.Document mergeDocuments​(com.azure.cosmos.implementation.Document destination,
                                                                              com.azure.cosmos.implementation.Document source)
      • toContainerProperties

        public static com.azure.cosmos.models.CosmosContainerProperties toContainerProperties​(String containerId,
                                                                                              String containerPropertiesJson)
      • toThroughputProperties

        public static com.azure.cosmos.models.ThroughputProperties toThroughputProperties​(String throughputPropertiesJson)
      • extractPartitionKeyPath

        public static String extractPartitionKeyPath​(com.azure.cosmos.CosmosContainer cosmosContainer)
      • extractPartitionKeyByPath

        public static com.azure.cosmos.models.PartitionKey extractPartitionKeyByPath​(com.azure.cosmos.implementation.Document document,
                                                                                     String path)
      • extractPartitionKey

        public static com.azure.cosmos.models.PartitionKey extractPartitionKey​(com.azure.cosmos.implementation.Document document,
                                                                               com.azure.cosmos.CosmosContainer cosmosContainer)