/** * 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 (getSimilarity() != null) sb.append("Similarity: ").append(getSimilarity()).append(","); if (getFace() != null) sb.append("Face: ").append(getFace()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof FaceMatch == false) return false; FaceMatch other = (FaceMatch) obj; if (other.getSimilarity() == null ^ this.getSimilarity() == null) return false; if (other.getSimilarity() != null && other.getSimilarity().equals(this.getSimilarity()) == false) return false; if (other.getFace() == null ^ this.getFace() == null) return false; if (other.getFace() != null && other.getFace().equals(this.getFace()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(FaceMatch faceMatch, ProtocolMarshaller protocolMarshaller) { if (faceMatch == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(faceMatch.getSimilarity(), SIMILARITY_BINDING); protocolMarshaller.marshall(faceMatch.getFace(), FACE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * 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 (getSimilarity() != null) sb.append("Similarity: " + getSimilarity() + ","); if (getFace() != null) sb.append("Face: " + getFace()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof FaceMatch == false) return false; FaceMatch other = (FaceMatch) obj; if (other.getSimilarity() == null ^ this.getSimilarity() == null) return false; if (other.getSimilarity() != null && other.getSimilarity().equals(this.getSimilarity()) == false) return false; if (other.getFace() == null ^ this.getFace() == null) return false; if (other.getFace() != null && other.getFace().equals(this.getFace()) == false) return false; return true; } }
public void marshall(FaceMatch faceMatch, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (faceMatch.getSimilarity() != null) { Float similarity = faceMatch.getSimilarity(); jsonWriter.name("Similarity"); jsonWriter.value(similarity); } if (faceMatch.getFace() != null) { Face face = faceMatch.getFace(); jsonWriter.name("Face"); FaceJsonMarshaller.getInstance().marshall(face, jsonWriter); } jsonWriter.endObject(); }