/* * 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; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

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

*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Celebrity implements Serializable, Cloneable, StructuredPojo { /** *

* 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. *

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

*/ private Float matchConfidence; 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. *

*

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

* * @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 Returns a reference to this object so that method calls can be chained together. */ public Celebrity withUrls(String... urls) { if (this.urls == null) { setUrls(new java.util.ArrayList(urls.length)); } for (String ele : urls) { this.urls.add(ele); } 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. *

* * @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 Returns a reference to this 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. *

* * @param name * The name of the celebrity. */ public void setName(String name) { this.name = name; } /** *

* The name of the celebrity. *

* * @return The name of the celebrity. */ public String getName() { return this.name; } /** *

* The name of the celebrity. *

* * @param name * The name of the celebrity. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withName(String name) { setName(name); return this; } /** *

* A unique identifier for the celebrity. *

* * @param id * A unique identifier for the celebrity. */ public void setId(String id) { this.id = id; } /** *

* A unique identifier for the celebrity. *

* * @return A unique identifier for the celebrity. */ public String getId() { return this.id; } /** *

* A unique identifier for the celebrity. *

* * @param id * A unique identifier for the celebrity. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withId(String id) { setId(id); return this; } /** *

* 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. *

* * @return Provides information about the celebrity's face, such as its location on the image. */ public ComparedFace getFace() { return this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withFace(ComparedFace face) { setFace(face); return this; } /** *

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

* * @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. *

* * @return The confidence, in percentage, that Amazon Rekognition has that the recognized face is the celebrity. */ public Float getMatchConfidence() { return this.matchConfidence; } /** *

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

* * @param matchConfidence * The confidence, in percentage, that Amazon Rekognition has that the recognized face is the celebrity. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withMatchConfidence(Float matchConfidence) { setMatchConfidence(matchConfidence); return this; } /** * @param knownGender */ public void setKnownGender(KnownGender knownGender) { this.knownGender = knownGender; } /** * @return */ public KnownGender getKnownGender() { return this.knownGender; } /** * @param knownGender * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withKnownGender(KnownGender knownGender) { setKnownGender(knownGender); 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 (getUrls() != null) sb.append("Urls: ").append(getUrls()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getFace() != null) sb.append("Face: ").append(getFace()).append(","); if (getMatchConfidence() != null) sb.append("MatchConfidence: ").append(getMatchConfidence()).append(","); if (getKnownGender() != null) sb.append("KnownGender: ").append(getKnownGender()); sb.append("}"); return sb.toString(); } @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; } @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 Celebrity clone() { try { return (Celebrity) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.rekognition.model.transform.CelebrityMarshaller.getInstance().marshall(this, protocolMarshaller); } }