/* * Copyright 2010-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; /** *
* Describes the face properties such as the bounding box, face ID, image ID of * the input image, and external image ID that you assigned. *
*/ public class Face implements Serializable { /** ** Unique identifier that Amazon Rekognition assigns to the face. *
*
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*/
private String faceId;
/**
*
* Bounding box of the face. *
*/ private BoundingBox boundingBox; /** ** Unique identifier that Amazon Rekognition assigns to the input image. *
*
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*/
private String imageId;
/**
*
* Identifier that you assign to all the faces in the input image. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-:]+
*/
private String externalImageId;
/**
*
* Confidence level that the bounding box contains a face (and not a * different object such as a tree). *
*
* Constraints:
* Length: 0.0 - 100.0
*/
private Float confidence;
/**
*
* The version of the face detect and storage model that was used when * indexing the face vector. *
*
* Constraints:
* Pattern: [0-9\.]+
*/
private String indexFacesModelVersion;
/**
*
* Unique identifier assigned to the user. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.\-:]+
*/
private String userId;
/**
*
* Unique identifier that Amazon Rekognition assigns to the face. *
*
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*
* @return
* Unique identifier that Amazon Rekognition assigns to the face. *
*/ public String getFaceId() { return faceId; } /** ** Unique identifier that Amazon Rekognition assigns to the face. *
*
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*
* @param faceId
* Unique identifier that Amazon Rekognition assigns to the face. *
*/ public void setFaceId(String faceId) { this.faceId = faceId; } /** ** Unique identifier that Amazon Rekognition assigns to the face. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*
* @param faceId
* Unique identifier that Amazon Rekognition assigns to the face. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Face withFaceId(String faceId) { this.faceId = faceId; return this; } /** ** Bounding box of the face. *
* * @return* Bounding box of the face. *
*/ public BoundingBox getBoundingBox() { return boundingBox; } /** ** Bounding box of the face. *
* * @param boundingBox* Bounding box of the face. *
*/ public void setBoundingBox(BoundingBox boundingBox) { this.boundingBox = boundingBox; } /** ** Bounding box of the face. *
** Returns a reference to this object so that method calls can be chained * together. * * @param boundingBox
* Bounding box of the face. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Face withBoundingBox(BoundingBox boundingBox) { this.boundingBox = boundingBox; return this; } /** ** Unique identifier that Amazon Rekognition assigns to the input image. *
*
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*
* @return
* Unique identifier that Amazon Rekognition assigns to the input * image. *
*/ public String getImageId() { return imageId; } /** ** Unique identifier that Amazon Rekognition assigns to the input image. *
*
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*
* @param imageId
* Unique identifier that Amazon Rekognition assigns to the input * image. *
*/ public void setImageId(String imageId) { this.imageId = imageId; } /** ** Unique identifier that Amazon Rekognition assigns to the input image. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Pattern:
* [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
*
* @param imageId
* Unique identifier that Amazon Rekognition assigns to the input * image. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Face withImageId(String imageId) { this.imageId = imageId; return this; } /** ** Identifier that you assign to all the faces in the input image. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-:]+
*
* @return
* Identifier that you assign to all the faces in the input image. *
*/ public String getExternalImageId() { return externalImageId; } /** ** Identifier that you assign to all the faces in the input image. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-:]+
*
* @param externalImageId
* Identifier that you assign to all the faces in the input * image. *
*/ public void setExternalImageId(String externalImageId) { this.externalImageId = externalImageId; } /** ** Identifier that you assign to all the faces in the input image. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-:]+
*
* @param externalImageId
* Identifier that you assign to all the faces in the input * image. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Face withExternalImageId(String externalImageId) { this.externalImageId = externalImageId; return this; } /** ** Confidence level that the bounding box contains a face (and not a * different object such as a tree). *
*
* Constraints:
* Length: 0.0 - 100.0
*
* @return
* Confidence level that the bounding box contains a face (and not a * different object such as a tree). *
*/ public Float getConfidence() { return confidence; } /** ** Confidence level that the bounding box contains a face (and not a * different object such as a tree). *
*
* Constraints:
* Length: 0.0 - 100.0
*
* @param confidence
* Confidence level that the bounding box contains a face (and * not a different object such as a tree). *
*/ public void setConfidence(Float confidence) { this.confidence = confidence; } /** ** Confidence level that the bounding box contains a face (and not a * different object such as a tree). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0.0 - 100.0
*
* @param confidence
* Confidence level that the bounding box contains a face (and * not a different object such as a tree). *
* @return A reference to this updated object so that method calls can be * chained together. */ public Face withConfidence(Float confidence) { this.confidence = confidence; return this; } /** ** The version of the face detect and storage model that was used when * indexing the face vector. *
*
* Constraints:
* Pattern: [0-9\.]+
*
* @return
* The version of the face detect and storage model that was used * when indexing the face vector. *
*/ public String getIndexFacesModelVersion() { return indexFacesModelVersion; } /** ** The version of the face detect and storage model that was used when * indexing the face vector. *
*
* Constraints:
* Pattern: [0-9\.]+
*
* @param indexFacesModelVersion
* The version of the face detect and storage model that was used * when indexing the face vector. *
*/ public void setIndexFacesModelVersion(String indexFacesModelVersion) { this.indexFacesModelVersion = indexFacesModelVersion; } /** ** The version of the face detect and storage model that was used when * indexing the face vector. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Pattern: [0-9\.]+
*
* @param indexFacesModelVersion
* The version of the face detect and storage model that was used * when indexing the face vector. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Face withIndexFacesModelVersion(String indexFacesModelVersion) { this.indexFacesModelVersion = indexFacesModelVersion; return this; } /** ** Unique identifier assigned to the user. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.\-:]+
*
* @return
* Unique identifier assigned to the user. *
*/ public String getUserId() { return userId; } /** ** Unique identifier assigned to the user. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.\-:]+
*
* @param userId
* Unique identifier assigned to the user. *
*/ public void setUserId(String userId) { this.userId = userId; } /** ** Unique identifier assigned to the user. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.\-:]+
*
* @param userId
* Unique identifier assigned to the user. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Face withUserId(String userId) { this.userId = userId; return this; } /** * 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 (getFaceId() != null) sb.append("FaceId: " + getFaceId() + ","); if (getBoundingBox() != null) sb.append("BoundingBox: " + getBoundingBox() + ","); if (getImageId() != null) sb.append("ImageId: " + getImageId() + ","); if (getExternalImageId() != null) sb.append("ExternalImageId: " + getExternalImageId() + ","); if (getConfidence() != null) sb.append("Confidence: " + getConfidence() + ","); if (getIndexFacesModelVersion() != null) sb.append("IndexFacesModelVersion: " + getIndexFacesModelVersion() + ","); if (getUserId() != null) sb.append("UserId: " + getUserId()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); hashCode = prime * hashCode + ((getBoundingBox() == null) ? 0 : getBoundingBox().hashCode()); hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getExternalImageId() == null) ? 0 : getExternalImageId().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getIndexFacesModelVersion() == null) ? 0 : getIndexFacesModelVersion() .hashCode()); hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Face == false) return false; Face other = (Face) obj; if (other.getFaceId() == null ^ this.getFaceId() == null) return false; if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) return false; if (other.getBoundingBox() == null ^ this.getBoundingBox() == null) return false; if (other.getBoundingBox() != null && other.getBoundingBox().equals(this.getBoundingBox()) == false) return false; if (other.getImageId() == null ^ this.getImageId() == null) return false; if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; if (other.getExternalImageId() == null ^ this.getExternalImageId() == null) return false; if (other.getExternalImageId() != null && other.getExternalImageId().equals(this.getExternalImageId()) == false) return false; if (other.getConfidence() == null ^ this.getConfidence() == null) return false; if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == false) return false; if (other.getIndexFacesModelVersion() == null ^ this.getIndexFacesModelVersion() == null) return false; if (other.getIndexFacesModelVersion() != null && other.getIndexFacesModelVersion().equals(this.getIndexFacesModelVersion()) == false) return false; if (other.getUserId() == null ^ this.getUserId() == null) return false; if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) return false; return true; } }