/* * 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.geo.model; import java.io.Serializable; public class BatchPutGeofenceResult implements Serializable { /** *

* Contains additional error details for each geofence that failed to be * stored in a geofence collection. *

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

* Contains each geofence that was successfully stored in a geofence * collection. *

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

* Contains additional error details for each geofence that failed to be * stored in a geofence collection. *

* * @return

* Contains additional error details for each geofence that failed * to be stored in a geofence collection. *

*/ public java.util.List getErrors() { return errors; } /** *

* Contains additional error details for each geofence that failed to be * stored in a geofence collection. *

* * @param errors

* Contains additional error details for each geofence that * failed to be stored in a geofence collection. *

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

* Contains additional error details for each geofence that failed to be * stored in a geofence collection. *

*

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

* Contains additional error details for each geofence that * failed to be stored in a geofence collection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceResult withErrors(BatchPutGeofenceError... errors) { if (getErrors() == null) { this.errors = new java.util.ArrayList(errors.length); } for (BatchPutGeofenceError value : errors) { this.errors.add(value); } return this; } /** *

* Contains additional error details for each geofence that failed to be * stored in a geofence collection. *

*

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

* Contains additional error details for each geofence that * failed to be stored in a geofence collection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceResult withErrors(java.util.Collection errors) { setErrors(errors); return this; } /** *

* Contains each geofence that was successfully stored in a geofence * collection. *

* * @return

* Contains each geofence that was successfully stored in a geofence * collection. *

*/ public java.util.List getSuccesses() { return successes; } /** *

* Contains each geofence that was successfully stored in a geofence * collection. *

* * @param successes

* Contains each geofence that was successfully stored in a * geofence collection. *

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

* Contains each geofence that was successfully stored in a geofence * collection. *

*

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

* Contains each geofence that was successfully stored in a * geofence collection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceResult withSuccesses(BatchPutGeofenceSuccess... successes) { if (getSuccesses() == null) { this.successes = new java.util.ArrayList(successes.length); } for (BatchPutGeofenceSuccess value : successes) { this.successes.add(value); } return this; } /** *

* Contains each geofence that was successfully stored in a geofence * collection. *

*

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

* Contains each geofence that was successfully stored in a * geofence collection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceResult withSuccesses( java.util.Collection successes) { setSuccesses(successes); 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 (getErrors() != null) sb.append("Errors: " + getErrors() + ","); if (getSuccesses() != null) sb.append("Successes: " + getSuccesses()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getErrors() == null) ? 0 : getErrors().hashCode()); hashCode = prime * hashCode + ((getSuccesses() == null) ? 0 : getSuccesses().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BatchPutGeofenceResult == false) return false; BatchPutGeofenceResult other = (BatchPutGeofenceResult) obj; if (other.getErrors() == null ^ this.getErrors() == null) return false; if (other.getErrors() != null && other.getErrors().equals(this.getErrors()) == false) return false; if (other.getSuccesses() == null ^ this.getSuccesses() == null) return false; if (other.getSuccesses() != null && other.getSuccesses().equals(this.getSuccesses()) == false) return false; return true; } }