/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.rekognition.model; import java.io.Serializable; import javax.annotation.Generated; @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SearchUsersByImageResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* An array of UserID objects that matched the input face, along with the confidence in the match. The returned * structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse action is successful. *

*/ private java.util.List userMatches; /** *

* Version number of the face detection model associated with the input collection CollectionId. *

*/ private String faceModelVersion; /** *

* A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the confidence * in the bounding box, that was searched for matches. If no valid face is detected in the image the response will * contain no SearchedFace object. *

*/ private SearchedFaceDetails searchedFace; /** *

* List of UnsearchedFace objects. Contains the face details infered from the specified image but not used for * search. Contains reasons that describe why a face wasn't used for Search. *

*/ private java.util.List unsearchedFaces; /** *

* An array of UserID objects that matched the input face, along with the confidence in the match. The returned * structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse action is successful. *

* * @return An array of UserID objects that matched the input face, along with the confidence in the match. The * returned structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse * action is successful. */ public java.util.List getUserMatches() { return userMatches; } /** *

* An array of UserID objects that matched the input face, along with the confidence in the match. The returned * structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse action is successful. *

* * @param userMatches * An array of UserID objects that matched the input face, along with the confidence in the match. The * returned structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse * action is successful. */ public void setUserMatches(java.util.Collection userMatches) { if (userMatches == null) { this.userMatches = null; return; } this.userMatches = new java.util.ArrayList(userMatches); } /** *

* An array of UserID objects that matched the input face, along with the confidence in the match. The returned * structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse action is successful. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setUserMatches(java.util.Collection)} or {@link #withUserMatches(java.util.Collection)} if you want to * override the existing values. *

* * @param userMatches * An array of UserID objects that matched the input face, along with the confidence in the match. The * returned structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse * action is successful. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchUsersByImageResult withUserMatches(UserMatch... userMatches) { if (this.userMatches == null) { setUserMatches(new java.util.ArrayList(userMatches.length)); } for (UserMatch ele : userMatches) { this.userMatches.add(ele); } return this; } /** *

* An array of UserID objects that matched the input face, along with the confidence in the match. The returned * structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse action is successful. *

* * @param userMatches * An array of UserID objects that matched the input face, along with the confidence in the match. The * returned structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse * action is successful. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchUsersByImageResult withUserMatches(java.util.Collection userMatches) { setUserMatches(userMatches); return this; } /** *

* Version number of the face detection model associated with the input collection CollectionId. *

* * @param faceModelVersion * Version number of the face detection model associated with the input collection CollectionId. */ public void setFaceModelVersion(String faceModelVersion) { this.faceModelVersion = faceModelVersion; } /** *

* Version number of the face detection model associated with the input collection CollectionId. *

* * @return Version number of the face detection model associated with the input collection CollectionId. */ public String getFaceModelVersion() { return this.faceModelVersion; } /** *

* Version number of the face detection model associated with the input collection CollectionId. *

* * @param faceModelVersion * Version number of the face detection model associated with the input collection CollectionId. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchUsersByImageResult withFaceModelVersion(String faceModelVersion) { setFaceModelVersion(faceModelVersion); return this; } /** *

* A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the confidence * in the bounding box, that was searched for matches. If no valid face is detected in the image the response will * contain no SearchedFace object. *

* * @param searchedFace * A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the * confidence in the bounding box, that was searched for matches. If no valid face is detected in the image * the response will contain no SearchedFace object. */ public void setSearchedFace(SearchedFaceDetails searchedFace) { this.searchedFace = searchedFace; } /** *

* A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the confidence * in the bounding box, that was searched for matches. If no valid face is detected in the image the response will * contain no SearchedFace object. *

* * @return A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the * confidence in the bounding box, that was searched for matches. If no valid face is detected in the image * the response will contain no SearchedFace object. */ public SearchedFaceDetails getSearchedFace() { return this.searchedFace; } /** *

* A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the confidence * in the bounding box, that was searched for matches. If no valid face is detected in the image the response will * contain no SearchedFace object. *

* * @param searchedFace * A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the * confidence in the bounding box, that was searched for matches. If no valid face is detected in the image * the response will contain no SearchedFace object. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchUsersByImageResult withSearchedFace(SearchedFaceDetails searchedFace) { setSearchedFace(searchedFace); return this; } /** *

* List of UnsearchedFace objects. Contains the face details infered from the specified image but not used for * search. Contains reasons that describe why a face wasn't used for Search. *

* * @return List of UnsearchedFace objects. Contains the face details infered from the specified image but not used * for search. Contains reasons that describe why a face wasn't used for Search. */ public java.util.List getUnsearchedFaces() { return unsearchedFaces; } /** *

* List of UnsearchedFace objects. Contains the face details infered from the specified image but not used for * search. Contains reasons that describe why a face wasn't used for Search. *

* * @param unsearchedFaces * List of UnsearchedFace objects. Contains the face details infered from the specified image but not used * for search. Contains reasons that describe why a face wasn't used for Search. */ public void setUnsearchedFaces(java.util.Collection unsearchedFaces) { if (unsearchedFaces == null) { this.unsearchedFaces = null; return; } this.unsearchedFaces = new java.util.ArrayList(unsearchedFaces); } /** *

* List of UnsearchedFace objects. Contains the face details infered from the specified image but not used for * search. Contains reasons that describe why a face wasn't used for Search. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setUnsearchedFaces(java.util.Collection)} or {@link #withUnsearchedFaces(java.util.Collection)} if you * want to override the existing values. *

* * @param unsearchedFaces * List of UnsearchedFace objects. Contains the face details infered from the specified image but not used * for search. Contains reasons that describe why a face wasn't used for Search. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchUsersByImageResult withUnsearchedFaces(UnsearchedFace... unsearchedFaces) { if (this.unsearchedFaces == null) { setUnsearchedFaces(new java.util.ArrayList(unsearchedFaces.length)); } for (UnsearchedFace ele : unsearchedFaces) { this.unsearchedFaces.add(ele); } return this; } /** *

* List of UnsearchedFace objects. Contains the face details infered from the specified image but not used for * search. Contains reasons that describe why a face wasn't used for Search. *

* * @param unsearchedFaces * List of UnsearchedFace objects. Contains the face details infered from the specified image but not used * for search. Contains reasons that describe why a face wasn't used for Search. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchUsersByImageResult withUnsearchedFaces(java.util.Collection unsearchedFaces) { setUnsearchedFaces(unsearchedFaces); 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 (getUserMatches() != null) sb.append("UserMatches: ").append(getUserMatches()).append(","); if (getFaceModelVersion() != null) sb.append("FaceModelVersion: ").append(getFaceModelVersion()).append(","); if (getSearchedFace() != null) sb.append("SearchedFace: ").append(getSearchedFace()).append(","); if (getUnsearchedFaces() != null) sb.append("UnsearchedFaces: ").append(getUnsearchedFaces()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchUsersByImageResult == false) return false; SearchUsersByImageResult other = (SearchUsersByImageResult) obj; if (other.getUserMatches() == null ^ this.getUserMatches() == null) return false; if (other.getUserMatches() != null && other.getUserMatches().equals(this.getUserMatches()) == false) return false; if (other.getFaceModelVersion() == null ^ this.getFaceModelVersion() == null) return false; if (other.getFaceModelVersion() != null && other.getFaceModelVersion().equals(this.getFaceModelVersion()) == false) return false; if (other.getSearchedFace() == null ^ this.getSearchedFace() == null) return false; if (other.getSearchedFace() != null && other.getSearchedFace().equals(this.getSearchedFace()) == false) return false; if (other.getUnsearchedFaces() == null ^ this.getUnsearchedFaces() == null) return false; if (other.getUnsearchedFaces() != null && other.getUnsearchedFaces().equals(this.getUnsearchedFaces()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserMatches() == null) ? 0 : getUserMatches().hashCode()); hashCode = prime * hashCode + ((getFaceModelVersion() == null) ? 0 : getFaceModelVersion().hashCode()); hashCode = prime * hashCode + ((getSearchedFace() == null) ? 0 : getSearchedFace().hashCode()); hashCode = prime * hashCode + ((getUnsearchedFaces() == null) ? 0 : getUnsearchedFaces().hashCode()); return hashCode; } @Override public SearchUsersByImageResult clone() { try { return (SearchUsersByImageResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }