com.amazonaws.services.mturk.model.ReviewReport Maven / Gradle / Ivy
Show all versions of aws-java-sdk-mechanicalturkrequester Show documentation
/*
* Copyright 2015-2020 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.mturk.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains both ReviewResult and ReviewAction elements for a particular HIT.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReviewReport implements Serializable, Cloneable, StructuredPojo {
/**
*
* A list of ReviewResults objects for each action specified in the Review Policy.
*
*/
private java.util.List reviewResults;
/**
*
* A list of ReviewAction objects for each action specified in the Review Policy.
*
*/
private java.util.List reviewActions;
/**
*
* A list of ReviewResults objects for each action specified in the Review Policy.
*
*
* @return A list of ReviewResults objects for each action specified in the Review Policy.
*/
public java.util.List getReviewResults() {
return reviewResults;
}
/**
*
* A list of ReviewResults objects for each action specified in the Review Policy.
*
*
* @param reviewResults
* A list of ReviewResults objects for each action specified in the Review Policy.
*/
public void setReviewResults(java.util.Collection reviewResults) {
if (reviewResults == null) {
this.reviewResults = null;
return;
}
this.reviewResults = new java.util.ArrayList(reviewResults);
}
/**
*
* A list of ReviewResults objects for each action specified in the Review Policy.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReviewResults(java.util.Collection)} or {@link #withReviewResults(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param reviewResults
* A list of ReviewResults objects for each action specified in the Review Policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReviewReport withReviewResults(ReviewResultDetail... reviewResults) {
if (this.reviewResults == null) {
setReviewResults(new java.util.ArrayList(reviewResults.length));
}
for (ReviewResultDetail ele : reviewResults) {
this.reviewResults.add(ele);
}
return this;
}
/**
*
* A list of ReviewResults objects for each action specified in the Review Policy.
*
*
* @param reviewResults
* A list of ReviewResults objects for each action specified in the Review Policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReviewReport withReviewResults(java.util.Collection reviewResults) {
setReviewResults(reviewResults);
return this;
}
/**
*
* A list of ReviewAction objects for each action specified in the Review Policy.
*
*
* @return A list of ReviewAction objects for each action specified in the Review Policy.
*/
public java.util.List getReviewActions() {
return reviewActions;
}
/**
*
* A list of ReviewAction objects for each action specified in the Review Policy.
*
*
* @param reviewActions
* A list of ReviewAction objects for each action specified in the Review Policy.
*/
public void setReviewActions(java.util.Collection reviewActions) {
if (reviewActions == null) {
this.reviewActions = null;
return;
}
this.reviewActions = new java.util.ArrayList(reviewActions);
}
/**
*
* A list of ReviewAction objects for each action specified in the Review Policy.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReviewActions(java.util.Collection)} or {@link #withReviewActions(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param reviewActions
* A list of ReviewAction objects for each action specified in the Review Policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReviewReport withReviewActions(ReviewActionDetail... reviewActions) {
if (this.reviewActions == null) {
setReviewActions(new java.util.ArrayList(reviewActions.length));
}
for (ReviewActionDetail ele : reviewActions) {
this.reviewActions.add(ele);
}
return this;
}
/**
*
* A list of ReviewAction objects for each action specified in the Review Policy.
*
*
* @param reviewActions
* A list of ReviewAction objects for each action specified in the Review Policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReviewReport withReviewActions(java.util.Collection reviewActions) {
setReviewActions(reviewActions);
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 (getReviewResults() != null)
sb.append("ReviewResults: ").append(getReviewResults()).append(",");
if (getReviewActions() != null)
sb.append("ReviewActions: ").append(getReviewActions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ReviewReport == false)
return false;
ReviewReport other = (ReviewReport) obj;
if (other.getReviewResults() == null ^ this.getReviewResults() == null)
return false;
if (other.getReviewResults() != null && other.getReviewResults().equals(this.getReviewResults()) == false)
return false;
if (other.getReviewActions() == null ^ this.getReviewActions() == null)
return false;
if (other.getReviewActions() != null && other.getReviewActions().equals(this.getReviewActions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getReviewResults() == null) ? 0 : getReviewResults().hashCode());
hashCode = prime * hashCode + ((getReviewActions() == null) ? 0 : getReviewActions().hashCode());
return hashCode;
}
@Override
public ReviewReport clone() {
try {
return (ReviewReport) 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.mturk.model.transform.ReviewReportMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}