@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> * Describes the face properties such as the bounding box, face ID, image ID of the source image, and external image * ID that you assigned. * </p> * * @param face * Describes the face properties such as the bounding box, face ID, image ID of the source image, and * external image ID that you assigned. * @return Returns a reference to this object so that method calls can be chained together. */ public FaceMatch withFace(Face face) { setFace(face); return this; }
/** * <p> * Confidence in the match of this face with the input face. * </p> * * @param similarity * Confidence in the match of this face with the input face. * @return Returns a reference to this object so that method calls can be chained together. */ public FaceMatch withSimilarity(Float similarity) { setSimilarity(similarity); return this; }
public FaceMatch unmarshall(JsonUnmarshallerContext context) throws Exception { FaceMatch faceMatch = new FaceMatch(); if (context.testExpression("Similarity", targetDepth)) { context.nextToken(); faceMatch.setSimilarity(context.getUnmarshaller(Float.class).unmarshall(context)); faceMatch.setFace(FaceJsonUnmarshaller.getInstance().unmarshall(context));
public FaceMatch unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } FaceMatch faceMatch = new FaceMatch(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Similarity")) { faceMatch.setSimilarity(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Face")) { faceMatch.setFace(FaceJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return faceMatch; }
@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; }
/** * 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(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); } }
@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 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; } }
/** * 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(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(); }