com.amazonaws.services.location.model.BatchPutGeofenceResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-location Show documentation
/*
* Copyright 2019-2024 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.location.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BatchPutGeofenceResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* 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.
*
*/
private java.util.List errors;
/**
*
* 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.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSuccesses(java.util.Collection)} or {@link #withSuccesses(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param successes
* Contains each geofence that was successfully stored in a geofence collection.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutGeofenceResult withSuccesses(BatchPutGeofenceSuccess... successes) {
if (this.successes == null) {
setSuccesses(new java.util.ArrayList(successes.length));
}
for (BatchPutGeofenceSuccess ele : successes) {
this.successes.add(ele);
}
return this;
}
/**
*
* Contains each geofence that was successfully stored in a geofence collection.
*
*
* @param successes
* Contains each geofence that was successfully stored in a geofence collection.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutGeofenceResult withSuccesses(java.util.Collection successes) {
setSuccesses(successes);
return this;
}
/**
*
* 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.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setErrors(java.util.Collection)} or {@link #withErrors(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param errors
* Contains additional error details for each geofence that failed to be stored in a geofence collection.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutGeofenceResult withErrors(BatchPutGeofenceError... errors) {
if (this.errors == null) {
setErrors(new java.util.ArrayList(errors.length));
}
for (BatchPutGeofenceError ele : errors) {
this.errors.add(ele);
}
return this;
}
/**
*
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutGeofenceResult withErrors(java.util.Collection errors) {
setErrors(errors);
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 (getSuccesses() != null)
sb.append("Successes: ").append(getSuccesses()).append(",");
if (getErrors() != null)
sb.append("Errors: ").append(getErrors());
sb.append("}");
return sb.toString();
}
@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.getSuccesses() == null ^ this.getSuccesses() == null)
return false;
if (other.getSuccesses() != null && other.getSuccesses().equals(this.getSuccesses()) == false)
return false;
if (other.getErrors() == null ^ this.getErrors() == null)
return false;
if (other.getErrors() != null && other.getErrors().equals(this.getErrors()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSuccesses() == null) ? 0 : getSuccesses().hashCode());
hashCode = prime * hashCode + ((getErrors() == null) ? 0 : getErrors().hashCode());
return hashCode;
}
@Override
public BatchPutGeofenceResult clone() {
try {
return (BatchPutGeofenceResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}