@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); return hashCode; }
/** * <p> * Name of the parameter from the Review policy. * </p> * * @param parameters * Name of the parameter from the Review policy. * @return Returns a reference to this object so that method calls can be chained together. */ public ReviewPolicy withParameters(java.util.Collection<PolicyParameter> parameters) { setParameters(parameters); return this; }
/** * <p> * Name of a Review Policy: SimplePlurality/2011-09-01 or ScoreMyKnownAnswers/2011-09-01 * </p> * * @param policyName * Name of a Review Policy: SimplePlurality/2011-09-01 or ScoreMyKnownAnswers/2011-09-01 * @return Returns a reference to this object so that method calls can be chained together. */ public ReviewPolicy withPolicyName(String policyName) { setPolicyName(policyName); return this; }
public ReviewPolicy unmarshall(JsonUnmarshallerContext context) throws Exception { ReviewPolicy reviewPolicy = new ReviewPolicy(); if (context.testExpression("PolicyName", targetDepth)) { context.nextToken(); reviewPolicy.setPolicyName(context.getUnmarshaller(String.class).unmarshall(context)); reviewPolicy.setParameters(new ListUnmarshaller<PolicyParameter>(PolicyParameterJsonUnmarshaller.getInstance()).unmarshall(context));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHITTypeId() == null) ? 0 : getHITTypeId().hashCode()); hashCode = prime * hashCode + ((getMaxAssignments() == null) ? 0 : getMaxAssignments().hashCode()); hashCode = prime * hashCode + ((getLifetimeInSeconds() == null) ? 0 : getLifetimeInSeconds().hashCode()); hashCode = prime * hashCode + ((getQuestion() == null) ? 0 : getQuestion().hashCode()); hashCode = prime * hashCode + ((getRequesterAnnotation() == null) ? 0 : getRequesterAnnotation().hashCode()); hashCode = prime * hashCode + ((getUniqueRequestToken() == null) ? 0 : getUniqueRequestToken().hashCode()); hashCode = prime * hashCode + ((getAssignmentReviewPolicy() == null) ? 0 : getAssignmentReviewPolicy().hashCode()); hashCode = prime * hashCode + ((getHITReviewPolicy() == null) ? 0 : getHITReviewPolicy().hashCode()); hashCode = prime * hashCode + ((getHITLayoutId() == null) ? 0 : getHITLayoutId().hashCode()); hashCode = prime * hashCode + ((getHITLayoutParameters() == null) ? 0 : getHITLayoutParameters().hashCode()); return hashCode; }
if (other.getAssignmentReviewPolicy() == null ^ this.getAssignmentReviewPolicy() == null) return false; if (other.getAssignmentReviewPolicy() != null && other.getAssignmentReviewPolicy().equals(this.getAssignmentReviewPolicy()) == false) return false; if (other.getHITReviewPolicy() == null ^ this.getHITReviewPolicy() == null) return false; if (other.getHITReviewPolicy() != null && other.getHITReviewPolicy().equals(this.getHITReviewPolicy()) == false) return false; if (other.getHITLayoutId() == null ^ this.getHITLayoutId() == null)
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHITId() == null) ? 0 : getHITId().hashCode()); hashCode = prime * hashCode + ((getAssignmentReviewPolicy() == null) ? 0 : getAssignmentReviewPolicy().hashCode()); hashCode = prime * hashCode + ((getHITReviewPolicy() == null) ? 0 : getHITReviewPolicy().hashCode()); hashCode = prime * hashCode + ((getAssignmentReviewReport() == null) ? 0 : getAssignmentReviewReport().hashCode()); hashCode = prime * hashCode + ((getHITReviewReport() == null) ? 0 : getHITReviewReport().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
if (other.getAssignmentReviewPolicy() == null ^ this.getAssignmentReviewPolicy() == null) return false; if (other.getAssignmentReviewPolicy() != null && other.getAssignmentReviewPolicy().equals(this.getAssignmentReviewPolicy()) == false) return false; if (other.getHITReviewPolicy() == null ^ this.getHITReviewPolicy() == null) return false; if (other.getHITReviewPolicy() != null && other.getHITReviewPolicy().equals(this.getHITReviewPolicy()) == false) return false; if (other.getAssignmentReviewReport() == null ^ this.getAssignmentReviewReport() == null)
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReviewPolicy == false) return false; ReviewPolicy other = (ReviewPolicy) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getParameters() == null ^ this.getParameters() == null) return false; if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMaxAssignments() == null) ? 0 : getMaxAssignments().hashCode()); hashCode = prime * hashCode + ((getAutoApprovalDelayInSeconds() == null) ? 0 : getAutoApprovalDelayInSeconds().hashCode()); hashCode = prime * hashCode + ((getLifetimeInSeconds() == null) ? 0 : getLifetimeInSeconds().hashCode()); hashCode = prime * hashCode + ((getAssignmentDurationInSeconds() == null) ? 0 : getAssignmentDurationInSeconds().hashCode()); hashCode = prime * hashCode + ((getReward() == null) ? 0 : getReward().hashCode()); hashCode = prime * hashCode + ((getTitle() == null) ? 0 : getTitle().hashCode()); hashCode = prime * hashCode + ((getKeywords() == null) ? 0 : getKeywords().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getQuestion() == null) ? 0 : getQuestion().hashCode()); hashCode = prime * hashCode + ((getRequesterAnnotation() == null) ? 0 : getRequesterAnnotation().hashCode()); hashCode = prime * hashCode + ((getQualificationRequirements() == null) ? 0 : getQualificationRequirements().hashCode()); hashCode = prime * hashCode + ((getUniqueRequestToken() == null) ? 0 : getUniqueRequestToken().hashCode()); hashCode = prime * hashCode + ((getAssignmentReviewPolicy() == null) ? 0 : getAssignmentReviewPolicy().hashCode()); hashCode = prime * hashCode + ((getHITReviewPolicy() == null) ? 0 : getHITReviewPolicy().hashCode()); hashCode = prime * hashCode + ((getHITLayoutId() == null) ? 0 : getHITLayoutId().hashCode()); hashCode = prime * hashCode + ((getHITLayoutParameters() == null) ? 0 : getHITLayoutParameters().hashCode()); return hashCode; }
if (other.getAssignmentReviewPolicy() == null ^ this.getAssignmentReviewPolicy() == null) return false; if (other.getAssignmentReviewPolicy() != null && other.getAssignmentReviewPolicy().equals(this.getAssignmentReviewPolicy()) == false) return false; if (other.getHITReviewPolicy() == null ^ this.getHITReviewPolicy() == null) return false; if (other.getHITReviewPolicy() != null && other.getHITReviewPolicy().equals(this.getHITReviewPolicy()) == false) return false; if (other.getHITLayoutId() == null ^ this.getHITLayoutId() == null)
/** * <p> * Name of the parameter from the Review policy. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setParameters(java.util.Collection)} or {@link #withParameters(java.util.Collection)} if you want to * override the existing values. * </p> * * @param parameters * Name of the parameter from the Review policy. * @return Returns a reference to this object so that method calls can be chained together. */ public ReviewPolicy withParameters(PolicyParameter... parameters) { if (this.parameters == null) { setParameters(new java.util.ArrayList<PolicyParameter>(parameters.length)); } for (PolicyParameter ele : parameters) { this.parameters.add(ele); } 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 (getPolicyName() != null) sb.append("PolicyName: ").append(getPolicyName()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(ReviewPolicy reviewPolicy, ProtocolMarshaller protocolMarshaller) { if (reviewPolicy == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(reviewPolicy.getPolicyName(), POLICYNAME_BINDING); protocolMarshaller.marshall(reviewPolicy.getParameters(), PARAMETERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }