@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; }
public Assignment unmarshall(JsonUnmarshallerContext context) throws Exception { Assignment assignment = new Assignment(); if (context.testExpression("AssignmentId", targetDepth)) { context.nextToken(); assignment.setAssignmentId(context.getUnmarshaller(String.class).unmarshall(context)); assignment.setWorkerId(context.getUnmarshaller(String.class).unmarshall(context)); assignment.setHITId(context.getUnmarshaller(String.class).unmarshall(context)); assignment.setAssignmentStatus(context.getUnmarshaller(String.class).unmarshall(context)); assignment.setAutoApprovalTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); assignment.setAcceptTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); assignment.setSubmitTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); assignment.setApprovalTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); assignment.setRejectionTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); assignment.setDeadline(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); assignment.setAnswer(context.getUnmarshaller(String.class).unmarshall(context)); assignment.setRequesterFeedback(context.getUnmarshaller(String.class).unmarshall(context));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetAssignmentResult == false) return false; GetAssignmentResult other = (GetAssignmentResult) obj; if (other.getAssignment() == null ^ this.getAssignment() == null) return false; if (other.getAssignment() != null && other.getAssignment().equals(this.getAssignment()) == false) return false; if (other.getHIT() == null ^ this.getHIT() == null) return false; if (other.getHIT() != null && other.getHIT().equals(this.getHIT()) == false) return false; return true; }
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)
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();
/** * Marshall the given parameter object. */ public void marshall(Assignment assignment, ProtocolMarshaller protocolMarshaller) { if (assignment == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(assignment.getAssignmentId(), ASSIGNMENTID_BINDING); protocolMarshaller.marshall(assignment.getWorkerId(), WORKERID_BINDING); protocolMarshaller.marshall(assignment.getHITId(), HITID_BINDING); protocolMarshaller.marshall(assignment.getAssignmentStatus(), ASSIGNMENTSTATUS_BINDING); protocolMarshaller.marshall(assignment.getAutoApprovalTime(), AUTOAPPROVALTIME_BINDING); protocolMarshaller.marshall(assignment.getAcceptTime(), ACCEPTTIME_BINDING); protocolMarshaller.marshall(assignment.getSubmitTime(), SUBMITTIME_BINDING); protocolMarshaller.marshall(assignment.getApprovalTime(), APPROVALTIME_BINDING); protocolMarshaller.marshall(assignment.getRejectionTime(), REJECTIONTIME_BINDING); protocolMarshaller.marshall(assignment.getDeadline(), DEADLINE_BINDING); protocolMarshaller.marshall(assignment.getAnswer(), ANSWER_BINDING); protocolMarshaller.marshall(assignment.getRequesterFeedback(), REQUESTERFEEDBACK_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }