@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceImage() == null) ? 0 : getSourceImage().hashCode()); hashCode = prime * hashCode + ((getTargetImage() == null) ? 0 : getTargetImage().hashCode()); hashCode = prime * hashCode + ((getSimilarityThreshold() == null) ? 0 : getSimilarityThreshold().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 sourceImage * 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 CompareFacesRequest withSourceImage(Image sourceImage) { setSourceImage(sourceImage); return this; }
/** * <p> * The target 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 targetImage * The target 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 CompareFacesRequest withTargetImage(Image targetImage) { setTargetImage(targetImage); return this; }
/** * Constructs a new CompareFacesRequest object. Callers should use the * setter or fluent setter (with...) methods to initialize any additional * object members. * * @param sourceImage <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 targetImage <p> * The target 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 CompareFacesRequest(Image sourceImage, Image targetImage) { setSourceImage(sourceImage); setTargetImage(targetImage); }
/** * <p> * The minimum level of confidence in the face matches that a match must meet to be included in the * <code>FaceMatches</code> array. * </p> * * @param similarityThreshold * The minimum level of confidence in the face matches that a match must meet to be included in the * <code>FaceMatches</code> array. * @return Returns a reference to this object so that method calls can be chained together. */ public CompareFacesRequest withSimilarityThreshold(Float similarityThreshold) { setSimilarityThreshold(similarityThreshold); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CompareFacesRequest == false) return false; CompareFacesRequest other = (CompareFacesRequest) obj; if (other.getSourceImage() == null ^ this.getSourceImage() == null) return false; if (other.getSourceImage() != null && other.getSourceImage().equals(this.getSourceImage()) == false) return false; if (other.getTargetImage() == null ^ this.getTargetImage() == null) return false; if (other.getTargetImage() != null && other.getTargetImage().equals(this.getTargetImage()) == false) return false; if (other.getSimilarityThreshold() == null ^ this.getSimilarityThreshold() == null) return false; if (other.getSimilarityThreshold() != null && other.getSimilarityThreshold().equals(this.getSimilarityThreshold()) == false) return false; return true; }
/** * 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 (getSourceImage() != null) sb.append("SourceImage: ").append(getSourceImage()).append(","); if (getTargetImage() != null) sb.append("TargetImage: ").append(getTargetImage()).append(","); if (getSimilarityThreshold() != null) sb.append("SimilarityThreshold: ").append(getSimilarityThreshold()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(CompareFacesRequest compareFacesRequest, ProtocolMarshaller protocolMarshaller) { if (compareFacesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(compareFacesRequest.getSourceImage(), SOURCEIMAGE_BINDING); protocolMarshaller.marshall(compareFacesRequest.getTargetImage(), TARGETIMAGE_BINDING); protocolMarshaller.marshall(compareFacesRequest.getSimilarityThreshold(), SIMILARITYTHRESHOLD_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 + ((getSourceImage() == null) ? 0 : getSourceImage().hashCode()); hashCode = prime * hashCode + ((getTargetImage() == null) ? 0 : getTargetImage().hashCode()); hashCode = prime * hashCode + ((getSimilarityThreshold() == null) ? 0 : getSimilarityThreshold().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CompareFacesRequest == false) return false; CompareFacesRequest other = (CompareFacesRequest) obj; if (other.getSourceImage() == null ^ this.getSourceImage() == null) return false; if (other.getSourceImage() != null && other.getSourceImage().equals(this.getSourceImage()) == false) return false; if (other.getTargetImage() == null ^ this.getTargetImage() == null) return false; if (other.getTargetImage() != null && other.getTargetImage().equals(this.getTargetImage()) == false) return false; if (other.getSimilarityThreshold() == null ^ this.getSimilarityThreshold() == null) return false; if (other.getSimilarityThreshold() != null && other.getSimilarityThreshold().equals(this.getSimilarityThreshold()) == 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 (getSourceImage() != null) sb.append("SourceImage: " + getSourceImage() + ","); if (getTargetImage() != null) sb.append("TargetImage: " + getTargetImage() + ","); if (getSimilarityThreshold() != null) sb.append("SimilarityThreshold: " + getSimilarityThreshold()); sb.append("}"); return sb.toString(); }
jsonWriter.beginObject(); if (compareFacesRequest.getSourceImage() != null) { Image sourceImage = compareFacesRequest.getSourceImage(); jsonWriter.name("SourceImage"); ImageJsonMarshaller.getInstance().marshall(sourceImage, jsonWriter); if (compareFacesRequest.getTargetImage() != null) { Image targetImage = compareFacesRequest.getTargetImage(); jsonWriter.name("TargetImage"); ImageJsonMarshaller.getInstance().marshall(targetImage, jsonWriter); if (compareFacesRequest.getSimilarityThreshold() != null) { Float similarityThreshold = compareFacesRequest.getSimilarityThreshold(); jsonWriter.name("SimilarityThreshold"); jsonWriter.value(similarityThreshold);