public class CosmosContainerProperties extends Resource
A database may contain zero or more named containers and each container consists of zero or more JSON items. Being schema-free, the items in a container do not need to share the same structure or fields. Since containers are application resources, they can be authorized using either the master key or resource keys.
Constructor and Description |
---|
CosmosContainerProperties(String id,
PartitionKeyDefinition partitionKeyDefinition)
Constructor
|
CosmosContainerProperties(String id,
String partitionKeyPath)
Constructor
|
Modifier and Type | Method and Description |
---|---|
ConflictResolutionPolicy |
conflictResolutionPolicy()
Gets the conflictResolutionPolicy that is used for resolving conflicting writes
on documents in different regions, in a collection in the Azure Cosmos DB service.
|
CosmosContainerProperties |
conflictResolutionPolicy(ConflictResolutionPolicy value)
Sets the conflictResolutionPolicy that is used for resolving conflicting writes
on documents in different regions, in a collection in the Azure Cosmos DB service.
|
IndexingPolicy |
indexingPolicy()
Gets the container's indexing policy.
|
CosmosContainerProperties |
indexingPolicy(IndexingPolicy indexingPolicy)
Sets the container's indexing policy
|
PartitionKeyDefinition |
partitionKeyDefinition()
Gets the containers's partition key definition.
|
CosmosContainerProperties |
partitionKeyDefinition(PartitionKeyDefinition partitionKeyDefinition)
Sets the containers's partition key definition.
|
UniqueKeyPolicy |
uniqueKeyPolicy()
Gets the containers unique key policy
|
CosmosContainerProperties |
uniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy)
Sets the Containers unique key policy
|
etag, id, id, resourceId, resourceId, selfLink, timestamp
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getString, has, toJson, toJson, toObject, toString
public CosmosContainerProperties(String id, String partitionKeyPath)
id
- id of the ContainerpartitionKeyPath
- partition key pathpublic CosmosContainerProperties(String id, PartitionKeyDefinition partitionKeyDefinition)
id
- id of the containerpartitionKeyDefinition
- the PartitionKeyDefinition
public IndexingPolicy indexingPolicy()
public CosmosContainerProperties indexingPolicy(IndexingPolicy indexingPolicy)
indexingPolicy
- IndexingPolicy
the indexing policypublic UniqueKeyPolicy uniqueKeyPolicy()
public CosmosContainerProperties uniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy)
uniqueKeyPolicy
- the unique key policypublic PartitionKeyDefinition partitionKeyDefinition()
public CosmosContainerProperties partitionKeyDefinition(PartitionKeyDefinition partitionKeyDefinition)
partitionKeyDefinition
- the partition key definition.public ConflictResolutionPolicy conflictResolutionPolicy()
public CosmosContainerProperties conflictResolutionPolicy(ConflictResolutionPolicy value)
value
- ConflictResolutionPolicy to be used.Copyright © 2019. All rights reserved.