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

* A person detected by a call to DetectProtectiveEquipment. The API * returns all persons detected in the input image in an array of * ProtectiveEquipmentPerson objects. *

*/ public class ProtectiveEquipmentPerson implements Serializable { /** *

* An array of body parts detected on a person's body (including body parts * without PPE). *

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

* A bounding box around the detected person. *

*/ private BoundingBox boundingBox; /** *

* The confidence that Amazon Rekognition has that the bounding box contains * a person. *

*

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

* The identifier for the detected person. The identifier is only unique for * a single call to DetectProtectiveEquipment. *

*

* Constraints:
* Range: 0 -
*/ private Integer id; /** *

* An array of body parts detected on a person's body (including body parts * without PPE). *

* * @return

* An array of body parts detected on a person's body (including * body parts without PPE). *

*/ public java.util.List getBodyParts() { return bodyParts; } /** *

* An array of body parts detected on a person's body (including body parts * without PPE). *

* * @param bodyParts

* An array of body parts detected on a person's body (including * body parts without PPE). *

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

* An array of body parts detected on a person's body (including body parts * without PPE). *

*

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

* An array of body parts detected on a person's body (including * body parts without PPE). *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentPerson withBodyParts(ProtectiveEquipmentBodyPart... bodyParts) { if (getBodyParts() == null) { this.bodyParts = new java.util.ArrayList(bodyParts.length); } for (ProtectiveEquipmentBodyPart value : bodyParts) { this.bodyParts.add(value); } return this; } /** *

* An array of body parts detected on a person's body (including body parts * without PPE). *

*

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

* An array of body parts detected on a person's body (including * body parts without PPE). *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentPerson withBodyParts( java.util.Collection bodyParts) { setBodyParts(bodyParts); return this; } /** *

* A bounding box around the detected person. *

* * @return

* A bounding box around the detected person. *

*/ public BoundingBox getBoundingBox() { return boundingBox; } /** *

* A bounding box around the detected person. *

* * @param boundingBox

* A bounding box around the detected person. *

*/ public void setBoundingBox(BoundingBox boundingBox) { this.boundingBox = boundingBox; } /** *

* A bounding box around the detected person. *

*

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

* A bounding box around the detected person. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentPerson withBoundingBox(BoundingBox boundingBox) { this.boundingBox = boundingBox; return this; } /** *

* The confidence that Amazon Rekognition has that the bounding box contains * a person. *

*

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

* The confidence that Amazon Rekognition has that the bounding box * contains a person. *

*/ public Float getConfidence() { return confidence; } /** *

* The confidence that Amazon Rekognition has that the bounding box contains * a person. *

*

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

* The confidence that Amazon Rekognition has that the bounding * box contains a person. *

*/ public void setConfidence(Float confidence) { this.confidence = confidence; } /** *

* The confidence that Amazon Rekognition has that the bounding box contains * a person. *

*

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

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

* The confidence that Amazon Rekognition has that the bounding * box contains a person. *

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

* The identifier for the detected person. The identifier is only unique for * a single call to DetectProtectiveEquipment. *

*

* Constraints:
* Range: 0 -
* * @return

* The identifier for the detected person. The identifier is only * unique for a single call to * DetectProtectiveEquipment. *

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

* The identifier for the detected person. The identifier is only unique for * a single call to DetectProtectiveEquipment. *

*

* Constraints:
* Range: 0 -
* * @param id

* The identifier for the detected person. The identifier is only * unique for a single call to * DetectProtectiveEquipment. *

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

* The identifier for the detected person. The identifier is only unique for * a single call to DetectProtectiveEquipment. *

*

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

* Constraints:
* Range: 0 -
* * @param id

* The identifier for the detected person. The identifier is only * unique for a single call to * DetectProtectiveEquipment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentPerson withId(Integer id) { this.id = id; 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 (getBodyParts() != null) sb.append("BodyParts: " + getBodyParts() + ","); if (getBoundingBox() != null) sb.append("BoundingBox: " + getBoundingBox() + ","); if (getConfidence() != null) sb.append("Confidence: " + getConfidence() + ","); if (getId() != null) sb.append("Id: " + getId()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBodyParts() == null) ? 0 : getBodyParts().hashCode()); hashCode = prime * hashCode + ((getBoundingBox() == null) ? 0 : getBoundingBox().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ProtectiveEquipmentPerson == false) return false; ProtectiveEquipmentPerson other = (ProtectiveEquipmentPerson) obj; if (other.getBodyParts() == null ^ this.getBodyParts() == null) return false; if (other.getBodyParts() != null && other.getBodyParts().equals(this.getBodyParts()) == 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.getConfidence() == null ^ this.getConfidence() == null) return false; if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; return true; } }