public final class ConsistencyPolicy extends Object
| Constructor and Description |
|---|
ConsistencyPolicy() |
| Modifier and Type | Method and Description |
|---|---|
DefaultConsistencyLevel |
defaultConsistencyLevel()
Get the defaultConsistencyLevel property: The default consistency level and configuration settings of the Cosmos
DB account.
|
Integer |
maxIntervalInSeconds()
Get the maxIntervalInSeconds property: When used with the Bounded Staleness consistency level, this value
represents the time amount of staleness (in seconds) tolerated.
|
Long |
maxStalenessPrefix()
Get the maxStalenessPrefix property: When used with the Bounded Staleness consistency level, this value
represents the number of stale requests tolerated.
|
void |
validate()
Validates the instance.
|
ConsistencyPolicy |
withDefaultConsistencyLevel(DefaultConsistencyLevel defaultConsistencyLevel)
Set the defaultConsistencyLevel property: The default consistency level and configuration settings of the Cosmos
DB account.
|
ConsistencyPolicy |
withMaxIntervalInSeconds(Integer maxIntervalInSeconds)
Set the maxIntervalInSeconds property: When used with the Bounded Staleness consistency level, this value
represents the time amount of staleness (in seconds) tolerated.
|
ConsistencyPolicy |
withMaxStalenessPrefix(Long maxStalenessPrefix)
Set the maxStalenessPrefix property: When used with the Bounded Staleness consistency level, this value
represents the number of stale requests tolerated.
|
public DefaultConsistencyLevel defaultConsistencyLevel()
public ConsistencyPolicy withDefaultConsistencyLevel(DefaultConsistencyLevel defaultConsistencyLevel)
defaultConsistencyLevel - the defaultConsistencyLevel value to set.public Long maxStalenessPrefix()
public ConsistencyPolicy withMaxStalenessPrefix(Long maxStalenessPrefix)
maxStalenessPrefix - the maxStalenessPrefix value to set.public Integer maxIntervalInSeconds()
public ConsistencyPolicy withMaxIntervalInSeconds(Integer maxIntervalInSeconds)
maxIntervalInSeconds - the maxIntervalInSeconds value to set.public void validate()
IllegalArgumentException - thrown if the instance is not valid.Copyright © 2020 Microsoft Corporation. All rights reserved.