Freigeben über


Conflict Class

public final class Conflict
extends Resource

Represents a conflict in the version of a particular resource in the Azure Cosmos DB database service.

During rare failure scenarios, conflicts are generated for the documents in transit. Clients can inspect the respective conflict instances for resources and operations in conflict.

Constructor Summary

Constructor Description
Conflict()

Initialize a conflict object.

Conflict(String jsonString)

Initialize a conflict object from json string.

Conflict(JSONObject jsonObject)

Initialize a conflict object from json object.

Method Summary

Modifier and Type Method and Description
T getResource(Class<T> resourceClass)

Gets the conflicting resource in the Azure Cosmos DB service.

OperationKind getOperationKind()

Gets the operation kind.

java.lang.String getResourceType()

Gets the type of the conflicting resource.

java.lang.String getSourceResourceId()

Gets the ID associated with the resource.

Methods inherited from JsonSerializable

Methods inherited from Resource

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Conflict

public Conflict()

Initialize a conflict object.

Conflict

public Conflict(String jsonString)

Initialize a conflict object from json string.

Parameters:

jsonString - the json string that represents the conflict.

Conflict

public Conflict(JSONObject jsonObject)

Initialize a conflict object from json object.

Parameters:

jsonObject - the json object that represents the conflict.

Method Details

getResource

public T getResource(Class resourceClass)

Gets the conflicting resource in the Azure Cosmos DB service.

Parameters:

resourceClass - The returned type of conflicting resource.

Returns:

The conflicting resource.

getOperationKind

public OperationKind getOperationKind()

Gets the operation kind.

Returns:

the operation kind.

getResourceType

public String getResourceType()

Gets the type of the conflicting resource.

Returns:

the resource type.

getSourceResourceId

public String getSourceResourceId()

Gets the ID associated with the resource.

Returns:

the ID associated with the resource.

Applies to