@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); hashCode = prime * hashCode + ((getMaxLabels() == null) ? 0 : getMaxLabels().hashCode()); hashCode = prime * hashCode + ((getMinConfidence() == null) ? 0 : getMinConfidence().hashCode()); return hashCode; }
/** * <p> * The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition * operations, passing base64-encoded image bytes is not supported. * </p> * * @param image * The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition * operations, passing base64-encoded image bytes is not supported. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectLabelsRequest withImage(Image image) { setImage(image); return this; }
/** * <p> * Maximum number of labels you want the service to return in the response. The service returns the specified number * of highest confidence labels. * </p> * * @param maxLabels * Maximum number of labels you want the service to return in the response. The service returns the specified * number of highest confidence labels. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectLabelsRequest withMaxLabels(Integer maxLabels) { setMaxLabels(maxLabels); return this; }
/** * <p> * Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels * with confidence lower than this specified value. * </p> * <p> * If <code>MinConfidence</code> is not specified, the operation returns labels with a confidence values greater * than or equal to 55 percent. * </p> * * @param minConfidence * Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any * labels with confidence lower than this specified value.</p> * <p> * If <code>MinConfidence</code> is not specified, the operation returns labels with a confidence values * greater than or equal to 55 percent. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectLabelsRequest withMinConfidence(Float minConfidence) { setMinConfidence(minConfidence); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DetectLabelsRequest == false) return false; DetectLabelsRequest other = (DetectLabelsRequest) obj; if (other.getImage() == null ^ this.getImage() == null) return false; if (other.getImage() != null && other.getImage().equals(this.getImage()) == false) return false; if (other.getMaxLabels() == null ^ this.getMaxLabels() == null) return false; if (other.getMaxLabels() != null && other.getMaxLabels().equals(this.getMaxLabels()) == false) return false; if (other.getMinConfidence() == null ^ this.getMinConfidence() == null) return false; if (other.getMinConfidence() != null && other.getMinConfidence().equals(this.getMinConfidence()) == false) return false; return true; }
/** * Constructs a new DetectLabelsRequest object. Callers should use the * setter or fluent setter (with...) methods to initialize any additional * object members. * * @param image <p> * The input image as base64-encoded bytes or an S3 object. If * you use the AWS CLI to call Amazon Rekognition operations, * passing base64-encoded image bytes is not supported. * </p> */ public DetectLabelsRequest(Image image) { setImage(image); }
/** * 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 (getImage() != null) sb.append("Image: ").append(getImage()).append(","); if (getMaxLabels() != null) sb.append("MaxLabels: ").append(getMaxLabels()).append(","); if (getMinConfidence() != null) sb.append("MinConfidence: ").append(getMinConfidence()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(DetectLabelsRequest detectLabelsRequest, ProtocolMarshaller protocolMarshaller) { if (detectLabelsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(detectLabelsRequest.getImage(), IMAGE_BINDING); protocolMarshaller.marshall(detectLabelsRequest.getMaxLabels(), MAXLABELS_BINDING); protocolMarshaller.marshall(detectLabelsRequest.getMinConfidence(), MINCONFIDENCE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); hashCode = prime * hashCode + ((getMaxLabels() == null) ? 0 : getMaxLabels().hashCode()); hashCode = prime * hashCode + ((getMinConfidence() == null) ? 0 : getMinConfidence().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DetectLabelsRequest == false) return false; DetectLabelsRequest other = (DetectLabelsRequest) obj; if (other.getImage() == null ^ this.getImage() == null) return false; if (other.getImage() != null && other.getImage().equals(this.getImage()) == false) return false; if (other.getMaxLabels() == null ^ this.getMaxLabels() == null) return false; if (other.getMaxLabels() != null && other.getMaxLabels().equals(this.getMaxLabels()) == false) return false; if (other.getMinConfidence() == null ^ this.getMinConfidence() == null) return false; if (other.getMinConfidence() != null && other.getMinConfidence().equals(this.getMinConfidence()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getImage() != null) sb.append("Image: " + getImage() + ","); if (getMaxLabels() != null) sb.append("MaxLabels: " + getMaxLabels() + ","); if (getMinConfidence() != null) sb.append("MinConfidence: " + getMinConfidence()); sb.append("}"); return sb.toString(); }
jsonWriter.beginObject(); if (detectLabelsRequest.getImage() != null) { Image image = detectLabelsRequest.getImage(); jsonWriter.name("Image"); ImageJsonMarshaller.getInstance().marshall(image, jsonWriter); if (detectLabelsRequest.getMaxLabels() != null) { Integer maxLabels = detectLabelsRequest.getMaxLabels(); jsonWriter.name("MaxLabels"); jsonWriter.value(maxLabels); if (detectLabelsRequest.getMinConfidence() != null) { Float minConfidence = detectLabelsRequest.getMinConfidence(); jsonWriter.name("MinConfidence"); jsonWriter.value(minConfidence);