/** * <p> * The QuestionID from the HIT that is used to identify which question requires Mechanical Turk to score as part of * the ScoreMyKnownAnswers/2011-09-01 Review Policy. * </p> * * @param key * The QuestionID from the HIT that is used to identify which question requires Mechanical Turk to score as * part of the ScoreMyKnownAnswers/2011-09-01 Review Policy. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterMapEntry withKey(String key) { setKey(key); return this; }
/** * <p> * The list of answers to the question specified in the MapEntry Key element. The Worker must match all values in * order for the answer to be scored correctly. * </p> * * @param values * The list of answers to the question specified in the MapEntry Key element. The Worker must match all * values in order for the answer to be scored correctly. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterMapEntry withValues(java.util.Collection<String> values) { setValues(values); return this; }
public ParameterMapEntry unmarshall(JsonUnmarshallerContext context) throws Exception { ParameterMapEntry parameterMapEntry = new ParameterMapEntry(); if (context.testExpression("Key", targetDepth)) { context.nextToken(); parameterMapEntry.setKey(context.getUnmarshaller(String.class).unmarshall(context)); parameterMapEntry.setValues(new ListUnmarshaller<String>(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 ParameterMapEntry == false) return false; ParameterMapEntry other = (ParameterMapEntry) obj; if (other.getKey() == null ^ this.getKey() == null) return false; if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getValues() == null ^ this.getValues() == null) return false; if (other.getValues() != null && other.getValues().equals(this.getValues()) == false) return false; return true; }
/** * <p> * The list of answers to the question specified in the MapEntry Key element. The Worker must match all values in * order for the answer to be scored correctly. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setValues(java.util.Collection)} or {@link #withValues(java.util.Collection)} if you want to override the * existing values. * </p> * * @param values * The list of answers to the question specified in the MapEntry Key element. The Worker must match all * values in order for the answer to be scored correctly. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterMapEntry withValues(String... values) { if (this.values == null) { setValues(new java.util.ArrayList<String>(values.length)); } for (String ele : values) { this.values.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 (getKey() != null) sb.append("Key: ").append(getKey()).append(","); if (getValues() != null) sb.append("Values: ").append(getValues()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(ParameterMapEntry parameterMapEntry, ProtocolMarshaller protocolMarshaller) { if (parameterMapEntry == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(parameterMapEntry.getKey(), KEY_BINDING); protocolMarshaller.marshall(parameterMapEntry.getValues(), VALUES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }