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

* Information about an item of Personal Protective Equipment (PPE) detected by * DetectProtectiveEquipment. For more information, see * DetectProtectiveEquipment. *

*/ public class EquipmentDetection implements Serializable { /** *

* A bounding box surrounding the item of detected PPE. *

*/ private BoundingBox boundingBox; /** *

* The confidence that Amazon Rekognition has that the bounding box ( * BoundingBox) contains an item of PPE. *

*

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

* The type of detected PPE. *

*

* Constraints:
* Allowed Values: FACE_COVER, HAND_COVER, HEAD_COVER */ private String type; /** *

* Information about the body part covered by the detected PPE. *

*/ private CoversBodyPart coversBodyPart; /** *

* A bounding box surrounding the item of detected PPE. *

* * @return

* A bounding box surrounding the item of detected PPE. *

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

* A bounding box surrounding the item of detected PPE. *

* * @param boundingBox

* A bounding box surrounding the item of detected PPE. *

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

* A bounding box surrounding the item of detected PPE. *

*

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

* A bounding box surrounding the item of detected PPE. *

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

* The confidence that Amazon Rekognition has that the bounding box ( * BoundingBox) contains an item of PPE. *

*

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

* The confidence that Amazon Rekognition has that the bounding box * (BoundingBox) contains an item of PPE. *

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

* The confidence that Amazon Rekognition has that the bounding box ( * BoundingBox) contains an item of PPE. *

*

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

* The confidence that Amazon Rekognition has that the bounding * box (BoundingBox) contains an item of PPE. *

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

* The confidence that Amazon Rekognition has that the bounding box ( * BoundingBox) contains an item of PPE. *

*

* 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 (BoundingBox) contains an item of PPE. *

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

* The type of detected PPE. *

*

* Constraints:
* Allowed Values: FACE_COVER, HAND_COVER, HEAD_COVER * * @return

* The type of detected PPE. *

* @see ProtectiveEquipmentType */ public String getType() { return type; } /** *

* The type of detected PPE. *

*

* Constraints:
* Allowed Values: FACE_COVER, HAND_COVER, HEAD_COVER * * @param type

* The type of detected PPE. *

* @see ProtectiveEquipmentType */ public void setType(String type) { this.type = type; } /** *

* The type of detected PPE. *

*

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

* Constraints:
* Allowed Values: FACE_COVER, HAND_COVER, HEAD_COVER * * @param type

* The type of detected PPE. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ProtectiveEquipmentType */ public EquipmentDetection withType(String type) { this.type = type; return this; } /** *

* The type of detected PPE. *

*

* Constraints:
* Allowed Values: FACE_COVER, HAND_COVER, HEAD_COVER * * @param type

* The type of detected PPE. *

* @see ProtectiveEquipmentType */ public void setType(ProtectiveEquipmentType type) { this.type = type.toString(); } /** *

* The type of detected PPE. *

*

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

* Constraints:
* Allowed Values: FACE_COVER, HAND_COVER, HEAD_COVER * * @param type

* The type of detected PPE. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ProtectiveEquipmentType */ public EquipmentDetection withType(ProtectiveEquipmentType type) { this.type = type.toString(); return this; } /** *

* Information about the body part covered by the detected PPE. *

* * @return

* Information about the body part covered by the detected PPE. *

*/ public CoversBodyPart getCoversBodyPart() { return coversBodyPart; } /** *

* Information about the body part covered by the detected PPE. *

* * @param coversBodyPart

* Information about the body part covered by the detected PPE. *

*/ public void setCoversBodyPart(CoversBodyPart coversBodyPart) { this.coversBodyPart = coversBodyPart; } /** *

* Information about the body part covered by the detected PPE. *

*

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

* Information about the body part covered by the detected PPE. *

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