/* * Copyright 2018-2023 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
* .
*
* 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. *
*
* The LambdaConflictHandlerConfig
when configuring LAMBDA
as the Conflict Handler.
*
* 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
* .
*
* 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
.
*
* 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
* .
*
* 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
.
*
* 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
* .
*
* 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
.
*
* 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
* .
*
* 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
.
*
* 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. *
** VERSION: Detect conflicts based on object versions for this resolver. *
** NONE: Do not detect conflicts when invoking this resolver. *
** 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. *
** VERSION: Detect conflicts based on object versions for this resolver. *
** NONE: Do not detect conflicts when invoking this resolver. *
** 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. *
** VERSION: Detect conflicts based on object versions for this resolver. *
** NONE: Do not detect conflicts when invoking this resolver. *
** 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. *
** VERSION: Detect conflicts based on object versions for this resolver. *
** NONE: Do not detect conflicts when invoking this resolver. *
*
* The LambdaConflictHandlerConfig
when configuring LAMBDA
as the Conflict Handler.
*
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.
*
LambdaConflictHandlerConfig
when configuring LAMBDA
as the Conflict
* Handler.
*/
public LambdaConflictHandlerConfig getLambdaConflictHandlerConfig() {
return this.lambdaConflictHandlerConfig;
}
/**
*
* The LambdaConflictHandlerConfig
when configuring LAMBDA
as the Conflict Handler.
*
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);
}
}