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

* Contains geofence geometry details. *

*/ public class BatchPutGeofenceRequestEntry implements Serializable { /** *

* The identifier for the geofence to be stored in a given geofence * collection. *

*

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\p{L}\p{N}]+$
*/ private String geofenceId; /** *

* Specifies additional user-defined properties to store with the Geofence. * An array of key-value pairs. *

*/ private java.util.Map geofenceProperties; /** *

* Contains the details of the position of the geofence. Can be either a * polygon or a circle. Including both will return a validation error. *

* *

* Each geofence polygon can have a maximum of 1,000 vertices. *

*
*/ private GeofenceGeometry geometry; /** *

* The identifier for the geofence to be stored in a given geofence * collection. *

*

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\p{L}\p{N}]+$
* * @return

* The identifier for the geofence to be stored in a given geofence * collection. *

*/ public String getGeofenceId() { return geofenceId; } /** *

* The identifier for the geofence to be stored in a given geofence * collection. *

*

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\p{L}\p{N}]+$
* * @param geofenceId

* The identifier for the geofence to be stored in a given * geofence collection. *

*/ public void setGeofenceId(String geofenceId) { this.geofenceId = geofenceId; } /** *

* The identifier for the geofence to be stored in a given geofence * collection. *

*

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

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\p{L}\p{N}]+$
* * @param geofenceId

* The identifier for the geofence to be stored in a given * geofence collection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceRequestEntry withGeofenceId(String geofenceId) { this.geofenceId = geofenceId; return this; } /** *

* Specifies additional user-defined properties to store with the Geofence. * An array of key-value pairs. *

* * @return

* Specifies additional user-defined properties to store with the * Geofence. An array of key-value pairs. *

*/ public java.util.Map getGeofenceProperties() { return geofenceProperties; } /** *

* Specifies additional user-defined properties to store with the Geofence. * An array of key-value pairs. *

* * @param geofenceProperties

* Specifies additional user-defined properties to store with the * Geofence. An array of key-value pairs. *

*/ public void setGeofenceProperties(java.util.Map geofenceProperties) { this.geofenceProperties = geofenceProperties; } /** *

* Specifies additional user-defined properties to store with the Geofence. * An array of key-value pairs. *

*

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

* Specifies additional user-defined properties to store with the * Geofence. An array of key-value pairs. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceRequestEntry withGeofenceProperties( java.util.Map geofenceProperties) { this.geofenceProperties = geofenceProperties; return this; } /** *

* Specifies additional user-defined properties to store with the Geofence. * An array of key-value pairs. *

*

* The method adds a new key-value pair into GeofenceProperties parameter, * and returns a reference to this object so that method calls can be * chained together. * * @param key The key of the entry to be added into GeofenceProperties. * @param value The corresponding value of the entry to be added into * GeofenceProperties. * @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceRequestEntry addGeofencePropertiesEntry(String key, String value) { if (null == this.geofenceProperties) { this.geofenceProperties = new java.util.HashMap(); } if (this.geofenceProperties.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.geofenceProperties.put(key, value); return this; } /** * Removes all the entries added into GeofenceProperties. *

* Returns a reference to this object so that method calls can be chained * together. */ public BatchPutGeofenceRequestEntry clearGeofencePropertiesEntries() { this.geofenceProperties = null; return this; } /** *

* Contains the details of the position of the geofence. Can be either a * polygon or a circle. Including both will return a validation error. *

* *

* Each geofence polygon can have a maximum of 1,000 vertices. *

*
* * @return

* Contains the details of the position of the geofence. Can be * either a polygon or a circle. Including both will return a * validation error. *

* *

* Each geofence polygon can have a maximum of 1,000 vertices. *

*
*/ public GeofenceGeometry getGeometry() { return geometry; } /** *

* Contains the details of the position of the geofence. Can be either a * polygon or a circle. Including both will return a validation error. *

* *

* Each geofence polygon can have a maximum of 1,000 vertices. *

*
* * @param geometry

* Contains the details of the position of the geofence. Can be * either a polygon or a circle. Including both will return a * validation error. *

* *

* Each geofence polygon can have a maximum of 1,000 vertices. *

*
*/ public void setGeometry(GeofenceGeometry geometry) { this.geometry = geometry; } /** *

* Contains the details of the position of the geofence. Can be either a * polygon or a circle. Including both will return a validation error. *

* *

* Each geofence polygon can have a maximum of 1,000 vertices. *

*
*

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

* Contains the details of the position of the geofence. Can be * either a polygon or a circle. Including both will return a * validation error. *

* *

* Each geofence polygon can have a maximum of 1,000 vertices. *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public BatchPutGeofenceRequestEntry withGeometry(GeofenceGeometry geometry) { this.geometry = geometry; 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 (getGeofenceId() != null) sb.append("GeofenceId: " + getGeofenceId() + ","); if (getGeofenceProperties() != null) sb.append("GeofenceProperties: " + getGeofenceProperties() + ","); if (getGeometry() != null) sb.append("Geometry: " + getGeometry()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getGeofenceId() == null) ? 0 : getGeofenceId().hashCode()); hashCode = prime * hashCode + ((getGeofenceProperties() == null) ? 0 : getGeofenceProperties().hashCode()); hashCode = prime * hashCode + ((getGeometry() == null) ? 0 : getGeometry().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BatchPutGeofenceRequestEntry == false) return false; BatchPutGeofenceRequestEntry other = (BatchPutGeofenceRequestEntry) obj; if (other.getGeofenceId() == null ^ this.getGeofenceId() == null) return false; if (other.getGeofenceId() != null && other.getGeofenceId().equals(this.getGeofenceId()) == false) return false; if (other.getGeofenceProperties() == null ^ this.getGeofenceProperties() == null) return false; if (other.getGeofenceProperties() != null && other.getGeofenceProperties().equals(this.getGeofenceProperties()) == false) return false; if (other.getGeometry() == null ^ this.getGeometry() == null) return false; if (other.getGeometry() != null && other.getGeometry().equals(this.getGeometry()) == false) return false; return true; } }