/* * 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; /** *

* Provides information about a celebrity recognized by the * RecognizeCelebrities operation. *

*/ public class Celebrity implements Serializable { /** *

* An array of URLs pointing to additional information about the celebrity. * If there is no additional information about the celebrity, this list is * empty. *

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

* The name of the celebrity. *

*/ private String name; /** *

* A unique identifier for the celebrity. *

*

* Constraints:
* Pattern: [0-9A-Za-z]*
*/ private String id; /** *

* Provides information about the celebrity's face, such as its location on * the image. *

*/ private ComparedFace face; /** *

* The confidence, in percentage, that Amazon Rekognition has that the * recognized face is the celebrity. *

*

* Constraints:
* Length: 0.0 - 100.0
*/ private Float matchConfidence; /** *

* The known gender identity for the celebrity that matches the provided ID. * The known gender identity can be Male, Female, Nonbinary, or Unlisted. *

*/ private KnownGender knownGender; /** *

* An array of URLs pointing to additional information about the celebrity. * If there is no additional information about the celebrity, this list is * empty. *

* * @return

* An array of URLs pointing to additional information about the * celebrity. If there is no additional information about the * celebrity, this list is empty. *

*/ public java.util.List getUrls() { return urls; } /** *

* An array of URLs pointing to additional information about the celebrity. * If there is no additional information about the celebrity, this list is * empty. *

* * @param urls

* An array of URLs pointing to additional information about the * celebrity. If there is no additional information about the * celebrity, this list is empty. *

*/ public void setUrls(java.util.Collection urls) { if (urls == null) { this.urls = null; return; } this.urls = new java.util.ArrayList(urls); } /** *

* An array of URLs pointing to additional information about the celebrity. * If there is no additional information about the celebrity, this list is * empty. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param urls

* An array of URLs pointing to additional information about the * celebrity. If there is no additional information about the * celebrity, this list is empty. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withUrls(String... urls) { if (getUrls() == null) { this.urls = new java.util.ArrayList(urls.length); } for (String value : urls) { this.urls.add(value); } return this; } /** *

* An array of URLs pointing to additional information about the celebrity. * If there is no additional information about the celebrity, this list is * empty. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param urls

* An array of URLs pointing to additional information about the * celebrity. If there is no additional information about the * celebrity, this list is empty. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withUrls(java.util.Collection urls) { setUrls(urls); return this; } /** *

* The name of the celebrity. *

* * @return

* The name of the celebrity. *

*/ public String getName() { return name; } /** *

* The name of the celebrity. *

* * @param name

* The name of the celebrity. *

*/ public void setName(String name) { this.name = name; } /** *

* The name of the celebrity. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param name

* The name of the celebrity. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withName(String name) { this.name = name; return this; } /** *

* A unique identifier for the celebrity. *

*

* Constraints:
* Pattern: [0-9A-Za-z]*
* * @return

* A unique identifier for the celebrity. *

*/ public String getId() { return id; } /** *

* A unique identifier for the celebrity. *

*

* Constraints:
* Pattern: [0-9A-Za-z]*
* * @param id

* A unique identifier for the celebrity. *

*/ public void setId(String id) { this.id = id; } /** *

* A unique identifier for the celebrity. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Pattern: [0-9A-Za-z]*
* * @param id

* A unique identifier for the celebrity. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withId(String id) { this.id = id; return this; } /** *

* Provides information about the celebrity's face, such as its location on * the image. *

* * @return

* Provides information about the celebrity's face, such as its * location on the image. *

*/ public ComparedFace getFace() { return face; } /** *

* Provides information about the celebrity's face, such as its location on * the image. *

* * @param face

* Provides information about the celebrity's face, such as its * location on the image. *

*/ public void setFace(ComparedFace face) { this.face = face; } /** *

* Provides information about the celebrity's face, such as its location on * the image. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param face

* Provides information about the celebrity's face, such as its * location on the image. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withFace(ComparedFace face) { this.face = face; return this; } /** *

* The confidence, in percentage, that Amazon Rekognition has that the * recognized face is the celebrity. *

*

* Constraints:
* Length: 0.0 - 100.0
* * @return

* The confidence, in percentage, that Amazon Rekognition has that * the recognized face is the celebrity. *

*/ public Float getMatchConfidence() { return matchConfidence; } /** *

* The confidence, in percentage, that Amazon Rekognition has that the * recognized face is the celebrity. *

*

* Constraints:
* Length: 0.0 - 100.0
* * @param matchConfidence

* The confidence, in percentage, that Amazon Rekognition has * that the recognized face is the celebrity. *

*/ public void setMatchConfidence(Float matchConfidence) { this.matchConfidence = matchConfidence; } /** *

* The confidence, in percentage, that Amazon Rekognition has that the * recognized face is the celebrity. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 0.0 - 100.0
* * @param matchConfidence

* The confidence, in percentage, that Amazon Rekognition has * that the recognized face is the celebrity. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withMatchConfidence(Float matchConfidence) { this.matchConfidence = matchConfidence; return this; } /** *

* The known gender identity for the celebrity that matches the provided ID. * The known gender identity can be Male, Female, Nonbinary, or Unlisted. *

* * @return

* The known gender identity for the celebrity that matches the * provided ID. The known gender identity can be Male, Female, * Nonbinary, or Unlisted. *

*/ public KnownGender getKnownGender() { return knownGender; } /** *

* The known gender identity for the celebrity that matches the provided ID. * The known gender identity can be Male, Female, Nonbinary, or Unlisted. *

* * @param knownGender

* The known gender identity for the celebrity that matches the * provided ID. The known gender identity can be Male, Female, * Nonbinary, or Unlisted. *

*/ public void setKnownGender(KnownGender knownGender) { this.knownGender = knownGender; } /** *

* The known gender identity for the celebrity that matches the provided ID. * The known gender identity can be Male, Female, Nonbinary, or Unlisted. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param knownGender

* The known gender identity for the celebrity that matches the * provided ID. The known gender identity can be Male, Female, * Nonbinary, or Unlisted. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withKnownGender(KnownGender knownGender) { this.knownGender = knownGender; 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 (getUrls() != null) sb.append("Urls: " + getUrls() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getId() != null) sb.append("Id: " + getId() + ","); if (getFace() != null) sb.append("Face: " + getFace() + ","); if (getMatchConfidence() != null) sb.append("MatchConfidence: " + getMatchConfidence() + ","); if (getKnownGender() != null) sb.append("KnownGender: " + getKnownGender()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUrls() == null) ? 0 : getUrls().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getFace() == null) ? 0 : getFace().hashCode()); hashCode = prime * hashCode + ((getMatchConfidence() == null) ? 0 : getMatchConfidence().hashCode()); hashCode = prime * hashCode + ((getKnownGender() == null) ? 0 : getKnownGender().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Celebrity == false) return false; Celebrity other = (Celebrity) obj; if (other.getUrls() == null ^ this.getUrls() == null) return false; if (other.getUrls() != null && other.getUrls().equals(this.getUrls()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getFace() == null ^ this.getFace() == null) return false; if (other.getFace() != null && other.getFace().equals(this.getFace()) == false) return false; if (other.getMatchConfidence() == null ^ this.getMatchConfidence() == null) return false; if (other.getMatchConfidence() != null && other.getMatchConfidence().equals(this.getMatchConfidence()) == false) return false; if (other.getKnownGender() == null ^ this.getKnownGender() == null) return false; if (other.getKnownGender() != null && other.getKnownGender().equals(this.getKnownGender()) == false) return false; return true; } }