@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSimilarity() == null) ? 0 : getSimilarity().hashCode()); hashCode = prime * hashCode + ((getFace() == null) ? 0 : getFace().hashCode()); return hashCode; }
/** * <p> * Provides face metadata (bounding box and confidence that the bounding box actually contains a face). * </p> * * @param face * Provides face metadata (bounding box and confidence that the bounding box actually contains a face). * @return Returns a reference to this object so that method calls can be chained together. */ public CompareFacesMatch withFace(ComparedFace face) { setFace(face); return this; }
/** * <p> * Level of confidence that the faces match. * </p> * * @param similarity * Level of confidence that the faces match. * @return Returns a reference to this object so that method calls can be chained together. */ public CompareFacesMatch withSimilarity(Float similarity) { setSimilarity(similarity); return this; }
public CompareFacesMatch unmarshall(JsonUnmarshallerContext context) throws Exception { CompareFacesMatch compareFacesMatch = new CompareFacesMatch(); if (context.testExpression("Similarity", targetDepth)) { context.nextToken(); compareFacesMatch.setSimilarity(context.getUnmarshaller(Float.class).unmarshall(context)); compareFacesMatch.setFace(ComparedFaceJsonUnmarshaller.getInstance().unmarshall(context));
public CompareFacesMatch unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } CompareFacesMatch compareFacesMatch = new CompareFacesMatch(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Similarity")) { compareFacesMatch.setSimilarity(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Face")) { compareFacesMatch.setFace(ComparedFaceJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return compareFacesMatch; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CompareFacesMatch == false) return false; CompareFacesMatch other = (CompareFacesMatch) 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; }
/** * 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(); }
/** * Marshall the given parameter object. */ public void marshall(CompareFacesMatch compareFacesMatch, ProtocolMarshaller protocolMarshaller) { if (compareFacesMatch == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(compareFacesMatch.getSimilarity(), SIMILARITY_BINDING); protocolMarshaller.marshall(compareFacesMatch.getFace(), FACE_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 + ((getSimilarity() == null) ? 0 : getSimilarity().hashCode()); hashCode = prime * hashCode + ((getFace() == null) ? 0 : getFace().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CompareFacesMatch == false) return false; CompareFacesMatch other = (CompareFacesMatch) 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; } }
/** * 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(); }
public void marshall(CompareFacesMatch compareFacesMatch, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (compareFacesMatch.getSimilarity() != null) { Float similarity = compareFacesMatch.getSimilarity(); jsonWriter.name("Similarity"); jsonWriter.value(similarity); } if (compareFacesMatch.getFace() != null) { ComparedFace face = compareFacesMatch.getFace(); jsonWriter.name("Face"); ComparedFaceJsonMarshaller.getInstance().marshall(face, jsonWriter); } jsonWriter.endObject(); }