All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.appsync.model.SyncConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS AppSync module holds the client classes that are used for communicating with AWS AppSync Service

There is a newer version: 1.12.780
Show newest version
/*
 * Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.appsync.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Describes a Sync configuration for a resolver. *

*

* Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SyncConfig implements Serializable, Cloneable, StructuredPojo { /** *

* The Conflict Resolution strategy to perform in the event of a conflict. *

*
    *
  • *

    * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest * version at the server. *

    *
  • *
  • *

    * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

    *
  • *
  • *

    * LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig * . *

    *
  • *
*/ private String conflictHandler; /** *

* The Conflict Detection strategy to use. *

*
    *
  • *

    * VERSION: Detect conflicts based on object versions for this resolver. *

    *
  • *
  • *

    * NONE: Do not detect conflicts when invoking this resolver. *

    *
  • *
*/ private String conflictDetection; /** *

* The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler. *

*/ private LambdaConflictHandlerConfig lambdaConflictHandlerConfig; /** *

* The Conflict Resolution strategy to perform in the event of a conflict. *

*
    *
  • *

    * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest * version at the server. *

    *
  • *
  • *

    * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

    *
  • *
  • *

    * LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig * . *

    *
  • *
* * @param conflictHandler * The Conflict Resolution strategy to perform in the event of a conflict.

*
    *
  • *

    * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the * latest version at the server. *

    *
  • *
  • *

    * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

    *
  • *
  • *

    * LAMBDA: Resolve conflicts with an Lambda function supplied in the * LambdaConflictHandlerConfig. *

    *
  • * @see ConflictHandlerType */ public void setConflictHandler(String conflictHandler) { this.conflictHandler = conflictHandler; } /** *

    * The Conflict Resolution strategy to perform in the event of a conflict. *

    *
      *
    • *

      * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest * version at the server. *

      *
    • *
    • *

      * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

      *
    • *
    • *

      * LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig * . *

      *
    • *
    * * @return The Conflict Resolution strategy to perform in the event of a conflict.

    *
      *
    • *

      * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the * latest version at the server. *

      *
    • *
    • *

      * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

      *
    • *
    • *

      * LAMBDA: Resolve conflicts with an Lambda function supplied in the * LambdaConflictHandlerConfig. *

      *
    • * @see ConflictHandlerType */ public String getConflictHandler() { return this.conflictHandler; } /** *

      * The Conflict Resolution strategy to perform in the event of a conflict. *

      *
        *
      • *

        * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest * version at the server. *

        *
      • *
      • *

        * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

        *
      • *
      • *

        * LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig * . *

        *
      • *
      * * @param conflictHandler * The Conflict Resolution strategy to perform in the event of a conflict.

      *
        *
      • *

        * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the * latest version at the server. *

        *
      • *
      • *

        * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

        *
      • *
      • *

        * LAMBDA: Resolve conflicts with an Lambda function supplied in the * LambdaConflictHandlerConfig. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. * @see ConflictHandlerType */ public SyncConfig withConflictHandler(String conflictHandler) { setConflictHandler(conflictHandler); return this; } /** *

        * The Conflict Resolution strategy to perform in the event of a conflict. *

        *
          *
        • *

          * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest * version at the server. *

          *
        • *
        • *

          * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

          *
        • *
        • *

          * LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig * . *

          *
        • *
        * * @param conflictHandler * The Conflict Resolution strategy to perform in the event of a conflict.

        *
          *
        • *

          * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the * latest version at the server. *

          *
        • *
        • *

          * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy. *

          *
        • *
        • *

          * LAMBDA: Resolve conflicts with an Lambda function supplied in the * LambdaConflictHandlerConfig. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. * @see ConflictHandlerType */ public SyncConfig withConflictHandler(ConflictHandlerType conflictHandler) { this.conflictHandler = conflictHandler.toString(); return this; } /** *

          * The Conflict Detection strategy to use. *

          *
            *
          • *

            * VERSION: Detect conflicts based on object versions for this resolver. *

            *
          • *
          • *

            * NONE: Do not detect conflicts when invoking this resolver. *

            *
          • *
          * * @param conflictDetection * The Conflict Detection strategy to use.

          *
            *
          • *

            * VERSION: Detect conflicts based on object versions for this resolver. *

            *
          • *
          • *

            * NONE: Do not detect conflicts when invoking this resolver. *

            *
          • * @see ConflictDetectionType */ public void setConflictDetection(String conflictDetection) { this.conflictDetection = conflictDetection; } /** *

            * The Conflict Detection strategy to use. *

            *
              *
            • *

              * VERSION: Detect conflicts based on object versions for this resolver. *

              *
            • *
            • *

              * NONE: Do not detect conflicts when invoking this resolver. *

              *
            • *
            * * @return The Conflict Detection strategy to use.

            *
              *
            • *

              * VERSION: Detect conflicts based on object versions for this resolver. *

              *
            • *
            • *

              * NONE: Do not detect conflicts when invoking this resolver. *

              *
            • * @see ConflictDetectionType */ public String getConflictDetection() { return this.conflictDetection; } /** *

              * The Conflict Detection strategy to use. *

              *
                *
              • *

                * VERSION: Detect conflicts based on object versions for this resolver. *

                *
              • *
              • *

                * NONE: Do not detect conflicts when invoking this resolver. *

                *
              • *
              * * @param conflictDetection * The Conflict Detection strategy to use.

              *
                *
              • *

                * VERSION: Detect conflicts based on object versions for this resolver. *

                *
              • *
              • *

                * NONE: Do not detect conflicts when invoking this resolver. *

                *
              • * @return Returns a reference to this object so that method calls can be chained together. * @see ConflictDetectionType */ public SyncConfig withConflictDetection(String conflictDetection) { setConflictDetection(conflictDetection); return this; } /** *

                * The Conflict Detection strategy to use. *

                *
                  *
                • *

                  * VERSION: Detect conflicts based on object versions for this resolver. *

                  *
                • *
                • *

                  * NONE: Do not detect conflicts when invoking this resolver. *

                  *
                • *
                * * @param conflictDetection * The Conflict Detection strategy to use.

                *
                  *
                • *

                  * VERSION: Detect conflicts based on object versions for this resolver. *

                  *
                • *
                • *

                  * NONE: Do not detect conflicts when invoking this resolver. *

                  *
                • * @return Returns a reference to this object so that method calls can be chained together. * @see ConflictDetectionType */ public SyncConfig withConflictDetection(ConflictDetectionType conflictDetection) { this.conflictDetection = conflictDetection.toString(); return this; } /** *

                  * The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler. *

                  * * @param lambdaConflictHandlerConfig * The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler. */ public void setLambdaConflictHandlerConfig(LambdaConflictHandlerConfig lambdaConflictHandlerConfig) { this.lambdaConflictHandlerConfig = lambdaConflictHandlerConfig; } /** *

                  * The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler. *

                  * * @return The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict * Handler. */ public LambdaConflictHandlerConfig getLambdaConflictHandlerConfig() { return this.lambdaConflictHandlerConfig; } /** *

                  * The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler. *

                  * * @param lambdaConflictHandlerConfig * The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler. * @return Returns a reference to this object so that method calls can be chained together. */ public SyncConfig withLambdaConflictHandlerConfig(LambdaConflictHandlerConfig lambdaConflictHandlerConfig) { setLambdaConflictHandlerConfig(lambdaConflictHandlerConfig); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getConflictHandler() != null) sb.append("ConflictHandler: ").append(getConflictHandler()).append(","); if (getConflictDetection() != null) sb.append("ConflictDetection: ").append(getConflictDetection()).append(","); if (getLambdaConflictHandlerConfig() != null) sb.append("LambdaConflictHandlerConfig: ").append(getLambdaConflictHandlerConfig()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SyncConfig == false) return false; SyncConfig other = (SyncConfig) obj; if (other.getConflictHandler() == null ^ this.getConflictHandler() == null) return false; if (other.getConflictHandler() != null && other.getConflictHandler().equals(this.getConflictHandler()) == false) return false; if (other.getConflictDetection() == null ^ this.getConflictDetection() == null) return false; if (other.getConflictDetection() != null && other.getConflictDetection().equals(this.getConflictDetection()) == false) return false; if (other.getLambdaConflictHandlerConfig() == null ^ this.getLambdaConflictHandlerConfig() == null) return false; if (other.getLambdaConflictHandlerConfig() != null && other.getLambdaConflictHandlerConfig().equals(this.getLambdaConflictHandlerConfig()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getConflictHandler() == null) ? 0 : getConflictHandler().hashCode()); hashCode = prime * hashCode + ((getConflictDetection() == null) ? 0 : getConflictDetection().hashCode()); hashCode = prime * hashCode + ((getLambdaConflictHandlerConfig() == null) ? 0 : getLambdaConflictHandlerConfig().hashCode()); return hashCode; } @Override public SyncConfig clone() { try { return (SyncConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.appsync.model.transform.SyncConfigMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy