Class ConflictResolutionPolicy

java.lang.Object
com.azure.resourcemanager.cosmos.models.ConflictResolutionPolicy
All Implemented Interfaces:
com.azure.json.JsonSerializable<ConflictResolutionPolicy>

public final class ConflictResolutionPolicy extends Object implements com.azure.json.JsonSerializable<ConflictResolutionPolicy>
The conflict resolution policy for the container.
  • Constructor Details

    • ConflictResolutionPolicy

      public ConflictResolutionPolicy()
      Creates an instance of ConflictResolutionPolicy class.
  • Method Details

    • mode

      public ConflictResolutionMode mode()
      Get the mode property: Indicates the conflict resolution mode.
      Returns:
      the mode value.
    • withMode

      Set the mode property: Indicates the conflict resolution mode.
      Parameters:
      mode - the mode value to set.
      Returns:
      the ConflictResolutionPolicy object itself.
    • conflictResolutionPath

      public String conflictResolutionPath()
      Get the conflictResolutionPath property: The conflict resolution path in the case of LastWriterWins mode.
      Returns:
      the conflictResolutionPath value.
    • withConflictResolutionPath

      public ConflictResolutionPolicy withConflictResolutionPath(String conflictResolutionPath)
      Set the conflictResolutionPath property: The conflict resolution path in the case of LastWriterWins mode.
      Parameters:
      conflictResolutionPath - the conflictResolutionPath value to set.
      Returns:
      the ConflictResolutionPolicy object itself.
    • conflictResolutionProcedure

      public String conflictResolutionProcedure()
      Get the conflictResolutionProcedure property: The procedure to resolve conflicts in the case of custom mode.
      Returns:
      the conflictResolutionProcedure value.
    • withConflictResolutionProcedure

      public ConflictResolutionPolicy withConflictResolutionProcedure(String conflictResolutionProcedure)
      Set the conflictResolutionProcedure property: The procedure to resolve conflicts in the case of custom mode.
      Parameters:
      conflictResolutionProcedure - the conflictResolutionProcedure value to set.
      Returns:
      the ConflictResolutionPolicy object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<ConflictResolutionPolicy>
      Throws:
      IOException
    • fromJson

      public static ConflictResolutionPolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ConflictResolutionPolicy from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ConflictResolutionPolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the ConflictResolutionPolicy.