com.amazonaws.services.mturk.model.Assignment Maven / Gradle / Ivy
Show all versions of aws-java-sdk-mechanicalturkrequester Show documentation
/*
* Copyright 2016-2021 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;
/**
*
* The Assignment data structure represents a single assignment of a HIT to a Worker. The assignment tracks the Worker's
* efforts to complete the HIT, and contains the results for later retrieval.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Assignment implements Serializable, Cloneable, StructuredPojo {
/**
*
* A unique identifier for the assignment.
*
*/
private String assignmentId;
/**
*
* The ID of the Worker who accepted the HIT.
*
*/
private String workerId;
/**
*
* The ID of the HIT.
*
*/
private String hITId;
/**
*
* The status of the assignment.
*
*/
private String assignmentStatus;
/**
*
* If results have been submitted, AutoApprovalTime is the date and time the results of the assignment results are
* considered Approved automatically if they have not already been explicitly approved or rejected by the Requester.
* This value is derived from the auto-approval delay specified by the Requester in the HIT. This value is omitted
* from the assignment if the Worker has not yet submitted results.
*
*/
private java.util.Date autoApprovalTime;
/**
*
* The date and time the Worker accepted the assignment.
*
*/
private java.util.Date acceptTime;
/**
*
* If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This value is
* omitted from the assignment if the Worker has not yet submitted results.
*
*/
private java.util.Date submitTime;
/**
*
* If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date and time
* the Requester approved the results. This value is omitted from the assignment if the Requester has not yet
* approved the results.
*
*/
private java.util.Date approvalTime;
/**
*
* If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date and
* time the Requester rejected the results.
*
*/
private java.util.Date rejectionTime;
/**
*
* The date and time of the deadline for the assignment. This value is derived from the deadline specification for
* the HIT and the date and time the Worker accepted the HIT.
*
*/
private java.util.Date deadline;
/**
*
* The Worker's answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker provides an
* answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers document, or Answer
* may be empty.
*
*/
private String answer;
/**
*
* The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment operation,
* if the Requester approved or rejected the assignment and specified feedback.
*
*/
private String requesterFeedback;
/**
*
* A unique identifier for the assignment.
*
*
* @param assignmentId
* A unique identifier for the assignment.
*/
public void setAssignmentId(String assignmentId) {
this.assignmentId = assignmentId;
}
/**
*
* A unique identifier for the assignment.
*
*
* @return A unique identifier for the assignment.
*/
public String getAssignmentId() {
return this.assignmentId;
}
/**
*
* A unique identifier for the assignment.
*
*
* @param assignmentId
* A unique identifier for the assignment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withAssignmentId(String assignmentId) {
setAssignmentId(assignmentId);
return this;
}
/**
*
* The ID of the Worker who accepted the HIT.
*
*
* @param workerId
* The ID of the Worker who accepted the HIT.
*/
public void setWorkerId(String workerId) {
this.workerId = workerId;
}
/**
*
* The ID of the Worker who accepted the HIT.
*
*
* @return The ID of the Worker who accepted the HIT.
*/
public String getWorkerId() {
return this.workerId;
}
/**
*
* The ID of the Worker who accepted the HIT.
*
*
* @param workerId
* The ID of the Worker who accepted the HIT.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withWorkerId(String workerId) {
setWorkerId(workerId);
return this;
}
/**
*
* The ID of the HIT.
*
*
* @param hITId
* The ID of the HIT.
*/
public void setHITId(String hITId) {
this.hITId = hITId;
}
/**
*
* The ID of the HIT.
*
*
* @return The ID of the HIT.
*/
public String getHITId() {
return this.hITId;
}
/**
*
* The ID of the HIT.
*
*
* @param hITId
* The ID of the HIT.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withHITId(String hITId) {
setHITId(hITId);
return this;
}
/**
*
* The status of the assignment.
*
*
* @param assignmentStatus
* The status of the assignment.
* @see AssignmentStatus
*/
public void setAssignmentStatus(String assignmentStatus) {
this.assignmentStatus = assignmentStatus;
}
/**
*
* The status of the assignment.
*
*
* @return The status of the assignment.
* @see AssignmentStatus
*/
public String getAssignmentStatus() {
return this.assignmentStatus;
}
/**
*
* The status of the assignment.
*
*
* @param assignmentStatus
* The status of the assignment.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AssignmentStatus
*/
public Assignment withAssignmentStatus(String assignmentStatus) {
setAssignmentStatus(assignmentStatus);
return this;
}
/**
*
* The status of the assignment.
*
*
* @param assignmentStatus
* The status of the assignment.
* @see AssignmentStatus
*/
public void setAssignmentStatus(AssignmentStatus assignmentStatus) {
withAssignmentStatus(assignmentStatus);
}
/**
*
* The status of the assignment.
*
*
* @param assignmentStatus
* The status of the assignment.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AssignmentStatus
*/
public Assignment withAssignmentStatus(AssignmentStatus assignmentStatus) {
this.assignmentStatus = assignmentStatus.toString();
return this;
}
/**
*
* If results have been submitted, AutoApprovalTime is the date and time the results of the assignment results are
* considered Approved automatically if they have not already been explicitly approved or rejected by the Requester.
* This value is derived from the auto-approval delay specified by the Requester in the HIT. This value is omitted
* from the assignment if the Worker has not yet submitted results.
*
*
* @param autoApprovalTime
* If results have been submitted, AutoApprovalTime is the date and time the results of the assignment
* results are considered Approved automatically if they have not already been explicitly approved or
* rejected by the Requester. This value is derived from the auto-approval delay specified by the Requester
* in the HIT. This value is omitted from the assignment if the Worker has not yet submitted results.
*/
public void setAutoApprovalTime(java.util.Date autoApprovalTime) {
this.autoApprovalTime = autoApprovalTime;
}
/**
*
* If results have been submitted, AutoApprovalTime is the date and time the results of the assignment results are
* considered Approved automatically if they have not already been explicitly approved or rejected by the Requester.
* This value is derived from the auto-approval delay specified by the Requester in the HIT. This value is omitted
* from the assignment if the Worker has not yet submitted results.
*
*
* @return If results have been submitted, AutoApprovalTime is the date and time the results of the assignment
* results are considered Approved automatically if they have not already been explicitly approved or
* rejected by the Requester. This value is derived from the auto-approval delay specified by the Requester
* in the HIT. This value is omitted from the assignment if the Worker has not yet submitted results.
*/
public java.util.Date getAutoApprovalTime() {
return this.autoApprovalTime;
}
/**
*
* If results have been submitted, AutoApprovalTime is the date and time the results of the assignment results are
* considered Approved automatically if they have not already been explicitly approved or rejected by the Requester.
* This value is derived from the auto-approval delay specified by the Requester in the HIT. This value is omitted
* from the assignment if the Worker has not yet submitted results.
*
*
* @param autoApprovalTime
* If results have been submitted, AutoApprovalTime is the date and time the results of the assignment
* results are considered Approved automatically if they have not already been explicitly approved or
* rejected by the Requester. This value is derived from the auto-approval delay specified by the Requester
* in the HIT. This value is omitted from the assignment if the Worker has not yet submitted results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withAutoApprovalTime(java.util.Date autoApprovalTime) {
setAutoApprovalTime(autoApprovalTime);
return this;
}
/**
*
* The date and time the Worker accepted the assignment.
*
*
* @param acceptTime
* The date and time the Worker accepted the assignment.
*/
public void setAcceptTime(java.util.Date acceptTime) {
this.acceptTime = acceptTime;
}
/**
*
* The date and time the Worker accepted the assignment.
*
*
* @return The date and time the Worker accepted the assignment.
*/
public java.util.Date getAcceptTime() {
return this.acceptTime;
}
/**
*
* The date and time the Worker accepted the assignment.
*
*
* @param acceptTime
* The date and time the Worker accepted the assignment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withAcceptTime(java.util.Date acceptTime) {
setAcceptTime(acceptTime);
return this;
}
/**
*
* If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This value is
* omitted from the assignment if the Worker has not yet submitted results.
*
*
* @param submitTime
* If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This
* value is omitted from the assignment if the Worker has not yet submitted results.
*/
public void setSubmitTime(java.util.Date submitTime) {
this.submitTime = submitTime;
}
/**
*
* If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This value is
* omitted from the assignment if the Worker has not yet submitted results.
*
*
* @return If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This
* value is omitted from the assignment if the Worker has not yet submitted results.
*/
public java.util.Date getSubmitTime() {
return this.submitTime;
}
/**
*
* If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This value is
* omitted from the assignment if the Worker has not yet submitted results.
*
*
* @param submitTime
* If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This
* value is omitted from the assignment if the Worker has not yet submitted results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withSubmitTime(java.util.Date submitTime) {
setSubmitTime(submitTime);
return this;
}
/**
*
* If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date and time
* the Requester approved the results. This value is omitted from the assignment if the Requester has not yet
* approved the results.
*
*
* @param approvalTime
* If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date
* and time the Requester approved the results. This value is omitted from the assignment if the Requester
* has not yet approved the results.
*/
public void setApprovalTime(java.util.Date approvalTime) {
this.approvalTime = approvalTime;
}
/**
*
* If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date and time
* the Requester approved the results. This value is omitted from the assignment if the Requester has not yet
* approved the results.
*
*
* @return If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date
* and time the Requester approved the results. This value is omitted from the assignment if the Requester
* has not yet approved the results.
*/
public java.util.Date getApprovalTime() {
return this.approvalTime;
}
/**
*
* If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date and time
* the Requester approved the results. This value is omitted from the assignment if the Requester has not yet
* approved the results.
*
*
* @param approvalTime
* If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date
* and time the Requester approved the results. This value is omitted from the assignment if the Requester
* has not yet approved the results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withApprovalTime(java.util.Date approvalTime) {
setApprovalTime(approvalTime);
return this;
}
/**
*
* If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date and
* time the Requester rejected the results.
*
*
* @param rejectionTime
* If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date
* and time the Requester rejected the results.
*/
public void setRejectionTime(java.util.Date rejectionTime) {
this.rejectionTime = rejectionTime;
}
/**
*
* If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date and
* time the Requester rejected the results.
*
*
* @return If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date
* and time the Requester rejected the results.
*/
public java.util.Date getRejectionTime() {
return this.rejectionTime;
}
/**
*
* If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date and
* time the Requester rejected the results.
*
*
* @param rejectionTime
* If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date
* and time the Requester rejected the results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withRejectionTime(java.util.Date rejectionTime) {
setRejectionTime(rejectionTime);
return this;
}
/**
*
* The date and time of the deadline for the assignment. This value is derived from the deadline specification for
* the HIT and the date and time the Worker accepted the HIT.
*
*
* @param deadline
* The date and time of the deadline for the assignment. This value is derived from the deadline
* specification for the HIT and the date and time the Worker accepted the HIT.
*/
public void setDeadline(java.util.Date deadline) {
this.deadline = deadline;
}
/**
*
* The date and time of the deadline for the assignment. This value is derived from the deadline specification for
* the HIT and the date and time the Worker accepted the HIT.
*
*
* @return The date and time of the deadline for the assignment. This value is derived from the deadline
* specification for the HIT and the date and time the Worker accepted the HIT.
*/
public java.util.Date getDeadline() {
return this.deadline;
}
/**
*
* The date and time of the deadline for the assignment. This value is derived from the deadline specification for
* the HIT and the date and time the Worker accepted the HIT.
*
*
* @param deadline
* The date and time of the deadline for the assignment. This value is derived from the deadline
* specification for the HIT and the date and time the Worker accepted the HIT.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withDeadline(java.util.Date deadline) {
setDeadline(deadline);
return this;
}
/**
*
* The Worker's answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker provides an
* answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers document, or Answer
* may be empty.
*
*
* @param answer
* The Worker's answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker
* provides an answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers
* document, or Answer may be empty.
*/
public void setAnswer(String answer) {
this.answer = answer;
}
/**
*
* The Worker's answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker provides an
* answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers document, or Answer
* may be empty.
*
*
* @return The Worker's answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker
* provides an answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers
* document, or Answer may be empty.
*/
public String getAnswer() {
return this.answer;
}
/**
*
* The Worker's answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker provides an
* answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers document, or Answer
* may be empty.
*
*
* @param answer
* The Worker's answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker
* provides an answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers
* document, or Answer may be empty.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withAnswer(String answer) {
setAnswer(answer);
return this;
}
/**
*
* The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment operation,
* if the Requester approved or rejected the assignment and specified feedback.
*
*
* @param requesterFeedback
* The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment
* operation, if the Requester approved or rejected the assignment and specified feedback.
*/
public void setRequesterFeedback(String requesterFeedback) {
this.requesterFeedback = requesterFeedback;
}
/**
*
* The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment operation,
* if the Requester approved or rejected the assignment and specified feedback.
*
*
* @return The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment
* operation, if the Requester approved or rejected the assignment and specified feedback.
*/
public String getRequesterFeedback() {
return this.requesterFeedback;
}
/**
*
* The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment operation,
* if the Requester approved or rejected the assignment and specified feedback.
*
*
* @param requesterFeedback
* The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment
* operation, if the Requester approved or rejected the assignment and specified feedback.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Assignment withRequesterFeedback(String requesterFeedback) {
setRequesterFeedback(requesterFeedback);
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 (getAssignmentId() != null)
sb.append("AssignmentId: ").append(getAssignmentId()).append(",");
if (getWorkerId() != null)
sb.append("WorkerId: ").append(getWorkerId()).append(",");
if (getHITId() != null)
sb.append("HITId: ").append(getHITId()).append(",");
if (getAssignmentStatus() != null)
sb.append("AssignmentStatus: ").append(getAssignmentStatus()).append(",");
if (getAutoApprovalTime() != null)
sb.append("AutoApprovalTime: ").append(getAutoApprovalTime()).append(",");
if (getAcceptTime() != null)
sb.append("AcceptTime: ").append(getAcceptTime()).append(",");
if (getSubmitTime() != null)
sb.append("SubmitTime: ").append(getSubmitTime()).append(",");
if (getApprovalTime() != null)
sb.append("ApprovalTime: ").append(getApprovalTime()).append(",");
if (getRejectionTime() != null)
sb.append("RejectionTime: ").append(getRejectionTime()).append(",");
if (getDeadline() != null)
sb.append("Deadline: ").append(getDeadline()).append(",");
if (getAnswer() != null)
sb.append("Answer: ").append(getAnswer()).append(",");
if (getRequesterFeedback() != null)
sb.append("RequesterFeedback: ").append(getRequesterFeedback());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Assignment == false)
return false;
Assignment other = (Assignment) obj;
if (other.getAssignmentId() == null ^ this.getAssignmentId() == null)
return false;
if (other.getAssignmentId() != null && other.getAssignmentId().equals(this.getAssignmentId()) == false)
return false;
if (other.getWorkerId() == null ^ this.getWorkerId() == null)
return false;
if (other.getWorkerId() != null && other.getWorkerId().equals(this.getWorkerId()) == false)
return false;
if (other.getHITId() == null ^ this.getHITId() == null)
return false;
if (other.getHITId() != null && other.getHITId().equals(this.getHITId()) == false)
return false;
if (other.getAssignmentStatus() == null ^ this.getAssignmentStatus() == null)
return false;
if (other.getAssignmentStatus() != null && other.getAssignmentStatus().equals(this.getAssignmentStatus()) == false)
return false;
if (other.getAutoApprovalTime() == null ^ this.getAutoApprovalTime() == null)
return false;
if (other.getAutoApprovalTime() != null && other.getAutoApprovalTime().equals(this.getAutoApprovalTime()) == false)
return false;
if (other.getAcceptTime() == null ^ this.getAcceptTime() == null)
return false;
if (other.getAcceptTime() != null && other.getAcceptTime().equals(this.getAcceptTime()) == false)
return false;
if (other.getSubmitTime() == null ^ this.getSubmitTime() == null)
return false;
if (other.getSubmitTime() != null && other.getSubmitTime().equals(this.getSubmitTime()) == false)
return false;
if (other.getApprovalTime() == null ^ this.getApprovalTime() == null)
return false;
if (other.getApprovalTime() != null && other.getApprovalTime().equals(this.getApprovalTime()) == false)
return false;
if (other.getRejectionTime() == null ^ this.getRejectionTime() == null)
return false;
if (other.getRejectionTime() != null && other.getRejectionTime().equals(this.getRejectionTime()) == false)
return false;
if (other.getDeadline() == null ^ this.getDeadline() == null)
return false;
if (other.getDeadline() != null && other.getDeadline().equals(this.getDeadline()) == false)
return false;
if (other.getAnswer() == null ^ this.getAnswer() == null)
return false;
if (other.getAnswer() != null && other.getAnswer().equals(this.getAnswer()) == false)
return false;
if (other.getRequesterFeedback() == null ^ this.getRequesterFeedback() == null)
return false;
if (other.getRequesterFeedback() != null && other.getRequesterFeedback().equals(this.getRequesterFeedback()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAssignmentId() == null) ? 0 : getAssignmentId().hashCode());
hashCode = prime * hashCode + ((getWorkerId() == null) ? 0 : getWorkerId().hashCode());
hashCode = prime * hashCode + ((getHITId() == null) ? 0 : getHITId().hashCode());
hashCode = prime * hashCode + ((getAssignmentStatus() == null) ? 0 : getAssignmentStatus().hashCode());
hashCode = prime * hashCode + ((getAutoApprovalTime() == null) ? 0 : getAutoApprovalTime().hashCode());
hashCode = prime * hashCode + ((getAcceptTime() == null) ? 0 : getAcceptTime().hashCode());
hashCode = prime * hashCode + ((getSubmitTime() == null) ? 0 : getSubmitTime().hashCode());
hashCode = prime * hashCode + ((getApprovalTime() == null) ? 0 : getApprovalTime().hashCode());
hashCode = prime * hashCode + ((getRejectionTime() == null) ? 0 : getRejectionTime().hashCode());
hashCode = prime * hashCode + ((getDeadline() == null) ? 0 : getDeadline().hashCode());
hashCode = prime * hashCode + ((getAnswer() == null) ? 0 : getAnswer().hashCode());
hashCode = prime * hashCode + ((getRequesterFeedback() == null) ? 0 : getRequesterFeedback().hashCode());
return hashCode;
}
@Override
public Assignment clone() {
try {
return (Assignment) 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.AssignmentMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}