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

* Summary information for required items of personal protective equipment (PPE) * detected on persons by a call to DetectProtectiveEquipment. You * specify the required type of PPE in the SummarizationAttributes * (ProtectiveEquipmentSummarizationAttributes) input parameter. The * summary includes which persons were detected wearing the required personal * protective equipment (PersonsWithRequiredEquipment), which * persons were detected as not wearing the required PPE ( * PersonsWithoutRequiredEquipment), and the persons in which a * determination could not be made (PersonsIndeterminate). *

*

* To get a total for each category, use the size of the field array. For * example, to find out how many people were detected as wearing the specified * PPE, use the size of the PersonsWithRequiredEquipment array. If * you want to find out more about a person, such as the location * (BoundingBox) of the person on the image, use the person ID in each * array element. Each person ID matches the ID field of a * ProtectiveEquipmentPerson object returned in the Persons * array by DetectProtectiveEquipment. *

*/ public class ProtectiveEquipmentSummary implements Serializable { /** *

* An array of IDs for persons who are wearing detected personal protective * equipment. *

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

* An array of IDs for persons who are not wearing all of the types of PPE * specified in the RequiredEquipmentTypes field of the * detected personal protective equipment. *

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

* An array of IDs for persons where it was not possible to determine if * they are wearing personal protective equipment. *

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

* An array of IDs for persons who are wearing detected personal protective * equipment. *

* * @return

* An array of IDs for persons who are wearing detected personal * protective equipment. *

*/ public java.util.List getPersonsWithRequiredEquipment() { return personsWithRequiredEquipment; } /** *

* An array of IDs for persons who are wearing detected personal protective * equipment. *

* * @param personsWithRequiredEquipment

* An array of IDs for persons who are wearing detected personal * protective equipment. *

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

* An array of IDs for persons who are wearing detected personal protective * equipment. *

*

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

* An array of IDs for persons who are wearing detected personal * protective equipment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentSummary withPersonsWithRequiredEquipment( Integer... personsWithRequiredEquipment) { if (getPersonsWithRequiredEquipment() == null) { this.personsWithRequiredEquipment = new java.util.ArrayList( personsWithRequiredEquipment.length); } for (Integer value : personsWithRequiredEquipment) { this.personsWithRequiredEquipment.add(value); } return this; } /** *

* An array of IDs for persons who are wearing detected personal protective * equipment. *

*

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

* An array of IDs for persons who are wearing detected personal * protective equipment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentSummary withPersonsWithRequiredEquipment( java.util.Collection personsWithRequiredEquipment) { setPersonsWithRequiredEquipment(personsWithRequiredEquipment); return this; } /** *

* An array of IDs for persons who are not wearing all of the types of PPE * specified in the RequiredEquipmentTypes field of the * detected personal protective equipment. *

* * @return

* An array of IDs for persons who are not wearing all of the types * of PPE specified in the RequiredEquipmentTypes field * of the detected personal protective equipment. *

*/ public java.util.List getPersonsWithoutRequiredEquipment() { return personsWithoutRequiredEquipment; } /** *

* An array of IDs for persons who are not wearing all of the types of PPE * specified in the RequiredEquipmentTypes field of the * detected personal protective equipment. *

* * @param personsWithoutRequiredEquipment

* An array of IDs for persons who are not wearing all of the * types of PPE specified in the * RequiredEquipmentTypes field of the detected * personal protective equipment. *

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

* An array of IDs for persons who are not wearing all of the types of PPE * specified in the RequiredEquipmentTypes field of the * detected personal protective equipment. *

*

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

* An array of IDs for persons who are not wearing all of the * types of PPE specified in the * RequiredEquipmentTypes field of the detected * personal protective equipment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentSummary withPersonsWithoutRequiredEquipment( Integer... personsWithoutRequiredEquipment) { if (getPersonsWithoutRequiredEquipment() == null) { this.personsWithoutRequiredEquipment = new java.util.ArrayList( personsWithoutRequiredEquipment.length); } for (Integer value : personsWithoutRequiredEquipment) { this.personsWithoutRequiredEquipment.add(value); } return this; } /** *

* An array of IDs for persons who are not wearing all of the types of PPE * specified in the RequiredEquipmentTypes field of the * detected personal protective equipment. *

*

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

* An array of IDs for persons who are not wearing all of the * types of PPE specified in the * RequiredEquipmentTypes field of the detected * personal protective equipment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentSummary withPersonsWithoutRequiredEquipment( java.util.Collection personsWithoutRequiredEquipment) { setPersonsWithoutRequiredEquipment(personsWithoutRequiredEquipment); return this; } /** *

* An array of IDs for persons where it was not possible to determine if * they are wearing personal protective equipment. *

* * @return

* An array of IDs for persons where it was not possible to * determine if they are wearing personal protective equipment. *

*/ public java.util.List getPersonsIndeterminate() { return personsIndeterminate; } /** *

* An array of IDs for persons where it was not possible to determine if * they are wearing personal protective equipment. *

* * @param personsIndeterminate

* An array of IDs for persons where it was not possible to * determine if they are wearing personal protective equipment. *

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

* An array of IDs for persons where it was not possible to determine if * they are wearing personal protective equipment. *

*

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

* An array of IDs for persons where it was not possible to * determine if they are wearing personal protective equipment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentSummary withPersonsIndeterminate(Integer... personsIndeterminate) { if (getPersonsIndeterminate() == null) { this.personsIndeterminate = new java.util.ArrayList( personsIndeterminate.length); } for (Integer value : personsIndeterminate) { this.personsIndeterminate.add(value); } return this; } /** *

* An array of IDs for persons where it was not possible to determine if * they are wearing personal protective equipment. *

*

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

* An array of IDs for persons where it was not possible to * determine if they are wearing personal protective equipment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ProtectiveEquipmentSummary withPersonsIndeterminate( java.util.Collection personsIndeterminate) { setPersonsIndeterminate(personsIndeterminate); 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 (getPersonsWithRequiredEquipment() != null) sb.append("PersonsWithRequiredEquipment: " + getPersonsWithRequiredEquipment() + ","); if (getPersonsWithoutRequiredEquipment() != null) sb.append("PersonsWithoutRequiredEquipment: " + getPersonsWithoutRequiredEquipment() + ","); if (getPersonsIndeterminate() != null) sb.append("PersonsIndeterminate: " + getPersonsIndeterminate()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPersonsWithRequiredEquipment() == null) ? 0 : getPersonsWithRequiredEquipment().hashCode()); hashCode = prime * hashCode + ((getPersonsWithoutRequiredEquipment() == null) ? 0 : getPersonsWithoutRequiredEquipment().hashCode()); hashCode = prime * hashCode + ((getPersonsIndeterminate() == null) ? 0 : getPersonsIndeterminate().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ProtectiveEquipmentSummary == false) return false; ProtectiveEquipmentSummary other = (ProtectiveEquipmentSummary) obj; if (other.getPersonsWithRequiredEquipment() == null ^ this.getPersonsWithRequiredEquipment() == null) return false; if (other.getPersonsWithRequiredEquipment() != null && other.getPersonsWithRequiredEquipment().equals( this.getPersonsWithRequiredEquipment()) == false) return false; if (other.getPersonsWithoutRequiredEquipment() == null ^ this.getPersonsWithoutRequiredEquipment() == null) return false; if (other.getPersonsWithoutRequiredEquipment() != null && other.getPersonsWithoutRequiredEquipment().equals( this.getPersonsWithoutRequiredEquipment()) == false) return false; if (other.getPersonsIndeterminate() == null ^ this.getPersonsIndeterminate() == null) return false; if (other.getPersonsIndeterminate() != null && other.getPersonsIndeterminate().equals(this.getPersonsIndeterminate()) == false) return false; return true; } }