com.amazonaws.services.appsync.model.EvaluateMappingTemplateResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-appsync Show documentation
/*
* 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;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EvaluateMappingTemplateResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The mapping template; this can be a request or response template.
*
*/
private String evaluationResult;
/**
*
* The ErrorDetail
object.
*
*/
private ErrorDetail error;
/**
*
* A list of logs that were generated by calls to util.log.info
and util.log.error
in the
* evaluated code.
*
*/
private java.util.List logs;
/**
*
* The mapping template; this can be a request or response template.
*
*
* @param evaluationResult
* The mapping template; this can be a request or response template.
*/
public void setEvaluationResult(String evaluationResult) {
this.evaluationResult = evaluationResult;
}
/**
*
* The mapping template; this can be a request or response template.
*
*
* @return The mapping template; this can be a request or response template.
*/
public String getEvaluationResult() {
return this.evaluationResult;
}
/**
*
* The mapping template; this can be a request or response template.
*
*
* @param evaluationResult
* The mapping template; this can be a request or response template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluateMappingTemplateResult withEvaluationResult(String evaluationResult) {
setEvaluationResult(evaluationResult);
return this;
}
/**
*
* The ErrorDetail
object.
*
*
* @param error
* The ErrorDetail
object.
*/
public void setError(ErrorDetail error) {
this.error = error;
}
/**
*
* The ErrorDetail
object.
*
*
* @return The ErrorDetail
object.
*/
public ErrorDetail getError() {
return this.error;
}
/**
*
* The ErrorDetail
object.
*
*
* @param error
* The ErrorDetail
object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluateMappingTemplateResult withError(ErrorDetail error) {
setError(error);
return this;
}
/**
*
* A list of logs that were generated by calls to util.log.info
and util.log.error
in the
* evaluated code.
*
*
* @return A list of logs that were generated by calls to util.log.info
and util.log.error
* in the evaluated code.
*/
public java.util.List getLogs() {
return logs;
}
/**
*
* A list of logs that were generated by calls to util.log.info
and util.log.error
in the
* evaluated code.
*
*
* @param logs
* A list of logs that were generated by calls to util.log.info
and util.log.error
* in the evaluated code.
*/
public void setLogs(java.util.Collection logs) {
if (logs == null) {
this.logs = null;
return;
}
this.logs = new java.util.ArrayList(logs);
}
/**
*
* A list of logs that were generated by calls to util.log.info
and util.log.error
in the
* evaluated code.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLogs(java.util.Collection)} or {@link #withLogs(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param logs
* A list of logs that were generated by calls to util.log.info
and util.log.error
* in the evaluated code.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluateMappingTemplateResult withLogs(String... logs) {
if (this.logs == null) {
setLogs(new java.util.ArrayList(logs.length));
}
for (String ele : logs) {
this.logs.add(ele);
}
return this;
}
/**
*
* A list of logs that were generated by calls to util.log.info
and util.log.error
in the
* evaluated code.
*
*
* @param logs
* A list of logs that were generated by calls to util.log.info
and util.log.error
* in the evaluated code.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluateMappingTemplateResult withLogs(java.util.Collection logs) {
setLogs(logs);
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 (getEvaluationResult() != null)
sb.append("EvaluationResult: ").append(getEvaluationResult()).append(",");
if (getError() != null)
sb.append("Error: ").append(getError()).append(",");
if (getLogs() != null)
sb.append("Logs: ").append(getLogs());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EvaluateMappingTemplateResult == false)
return false;
EvaluateMappingTemplateResult other = (EvaluateMappingTemplateResult) obj;
if (other.getEvaluationResult() == null ^ this.getEvaluationResult() == null)
return false;
if (other.getEvaluationResult() != null && other.getEvaluationResult().equals(this.getEvaluationResult()) == false)
return false;
if (other.getError() == null ^ this.getError() == null)
return false;
if (other.getError() != null && other.getError().equals(this.getError()) == false)
return false;
if (other.getLogs() == null ^ this.getLogs() == null)
return false;
if (other.getLogs() != null && other.getLogs().equals(this.getLogs()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEvaluationResult() == null) ? 0 : getEvaluationResult().hashCode());
hashCode = prime * hashCode + ((getError() == null) ? 0 : getError().hashCode());
hashCode = prime * hashCode + ((getLogs() == null) ? 0 : getLogs().hashCode());
return hashCode;
}
@Override
public EvaluateMappingTemplateResult clone() {
try {
return (EvaluateMappingTemplateResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}