@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSearchedFaceId() == null) ? 0 : getSearchedFaceId().hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); hashCode = prime * hashCode + ((getFaceModelVersion() == null) ? 0 : getFaceModelVersion().hashCode()); return hashCode; }
/** * <p> * An array of faces that matched the input face, along with the confidence in the match. * </p> * * @param faceMatches * An array of faces that matched the input face, along with the confidence in the match. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesResult withFaceMatches(java.util.Collection<FaceMatch> faceMatches) { setFaceMatches(faceMatches); return this; }
/** * <p> * Version number of the face detection model associated with the input collection (<code>CollectionId</code>). * </p> * * @param faceModelVersion * Version number of the face detection model associated with the input collection (<code>CollectionId</code> * ). * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesResult withFaceModelVersion(String faceModelVersion) { setFaceModelVersion(faceModelVersion); return this; }
public SearchFacesResult unmarshall(JsonUnmarshallerContext context) throws Exception { SearchFacesResult searchFacesResult = new SearchFacesResult(); if (context.testExpression("SearchedFaceId", targetDepth)) { context.nextToken(); searchFacesResult.setSearchedFaceId(context.getUnmarshaller(String.class).unmarshall(context)); searchFacesResult.setFaceMatches(new ListUnmarshaller<FaceMatch>(FaceMatchJsonUnmarshaller.getInstance()).unmarshall(context)); searchFacesResult.setFaceModelVersion(context.getUnmarshaller(String.class).unmarshall(context));
/** * <p> * ID of the face that was searched for matches in a collection. * </p> * * @param searchedFaceId * ID of the face that was searched for matches in a collection. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesResult withSearchedFaceId(String searchedFaceId) { setSearchedFaceId(searchedFaceId); return this; }
/** * <p> * An array of faces that matched the input face, along with the confidence * in the match. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param faceMatches <p> * An array of faces that matched the input face, along with the * confidence in the match. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public SearchFacesResult withFaceMatches(FaceMatch... faceMatches) { if (getFaceMatches() == null) { this.faceMatches = new java.util.ArrayList<FaceMatch>(faceMatches.length); } for (FaceMatch value : faceMatches) { this.faceMatches.add(value); } return this; }
public SearchFacesResult unmarshall(JsonUnmarshallerContext context) throws Exception { SearchFacesResult searchFacesResult = new SearchFacesResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("SearchedFaceId")) { searchFacesResult.setSearchedFaceId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("FaceMatches")) { searchFacesResult.setFaceMatches(new ListUnmarshaller<FaceMatch>( FaceMatchJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("FaceModelVersion")) { searchFacesResult.setFaceModelVersion(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return searchFacesResult; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchFacesResult == false) return false; SearchFacesResult other = (SearchFacesResult) obj; if (other.getSearchedFaceId() == null ^ this.getSearchedFaceId() == null) return false; if (other.getSearchedFaceId() != null && other.getSearchedFaceId().equals(this.getSearchedFaceId()) == false) return false; if (other.getFaceMatches() == null ^ this.getFaceMatches() == null) return false; if (other.getFaceMatches() != null && other.getFaceMatches().equals(this.getFaceMatches()) == false) return false; if (other.getFaceModelVersion() == null ^ this.getFaceModelVersion() == null) return false; if (other.getFaceModelVersion() != null && other.getFaceModelVersion().equals(this.getFaceModelVersion()) == false) return false; return true; }
/** * <p> * An array of faces that matched the input face, along with the confidence in the match. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setFaceMatches(java.util.Collection)} or {@link #withFaceMatches(java.util.Collection)} if you want to * override the existing values. * </p> * * @param faceMatches * An array of faces that matched the input face, along with the confidence in the match. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesResult withFaceMatches(FaceMatch... faceMatches) { if (this.faceMatches == null) { setFaceMatches(new java.util.ArrayList<FaceMatch>(faceMatches.length)); } for (FaceMatch ele : faceMatches) { this.faceMatches.add(ele); } return this; }
/** * 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 (getSearchedFaceId() != null) sb.append("SearchedFaceId: ").append(getSearchedFaceId()).append(","); if (getFaceMatches() != null) sb.append("FaceMatches: ").append(getFaceMatches()).append(","); if (getFaceModelVersion() != null) sb.append("FaceModelVersion: ").append(getFaceModelVersion()); sb.append("}"); return sb.toString(); }
/** * <p> * An array of faces that matched the input face, along with the confidence * in the match. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param faceMatches <p> * An array of faces that matched the input face, along with the * confidence in the match. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public SearchFacesResult withFaceMatches(java.util.Collection<FaceMatch> faceMatches) { setFaceMatches(faceMatches); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSearchedFaceId() == null) ? 0 : getSearchedFaceId().hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); hashCode = prime * hashCode + ((getFaceModelVersion() == null) ? 0 : getFaceModelVersion().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchFacesResult == false) return false; SearchFacesResult other = (SearchFacesResult) obj; if (other.getSearchedFaceId() == null ^ this.getSearchedFaceId() == null) return false; if (other.getSearchedFaceId() != null && other.getSearchedFaceId().equals(this.getSearchedFaceId()) == false) return false; if (other.getFaceMatches() == null ^ this.getFaceMatches() == null) return false; if (other.getFaceMatches() != null && other.getFaceMatches().equals(this.getFaceMatches()) == false) return false; if (other.getFaceModelVersion() == null ^ this.getFaceModelVersion() == null) return false; if (other.getFaceModelVersion() != null && other.getFaceModelVersion().equals(this.getFaceModelVersion()) == 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 (getSearchedFaceId() != null) sb.append("SearchedFaceId: " + getSearchedFaceId() + ","); if (getFaceMatches() != null) sb.append("FaceMatches: " + getFaceMatches() + ","); if (getFaceModelVersion() != null) sb.append("FaceModelVersion: " + getFaceModelVersion()); sb.append("}"); return sb.toString(); }