com.amazonaws.services.location.model.SearchPlaceIndexForPositionRequest 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;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SearchPlaceIndexForPositionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the place index resource you want to use for the search.
*
*/
private String indexName;
/**
*
* Specifies the longitude and latitude of the position to query.
*
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the
* second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
and
* latitude 49.2847
.
*
*/
private java.util.List position;
/**
*
* An optional parameter. The maximum number of results returned per request.
*
*
* Default value: 50
*
*/
private Integer maxResults;
/**
*
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for English.
*
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the result.
*
*
* For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
* language
parameter set to en
. The city
in the results will most likely be
* returned as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the city
in the
* results will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider does
* support.
*
*/
private String language;
/**
*
* The optional API key
* to authorize the request.
*
*/
private String key;
/**
*
* The name of the place index resource you want to use for the search.
*
*
* @param indexName
* The name of the place index resource you want to use for the search.
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
*
* The name of the place index resource you want to use for the search.
*
*
* @return The name of the place index resource you want to use for the search.
*/
public String getIndexName() {
return this.indexName;
}
/**
*
* The name of the place index resource you want to use for the search.
*
*
* @param indexName
* The name of the place index resource you want to use for the search.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchPlaceIndexForPositionRequest withIndexName(String indexName) {
setIndexName(indexName);
return this;
}
/**
*
* Specifies the longitude and latitude of the position to query.
*
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the
* second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
and
* latitude 49.2847
.
*
*
* @return Specifies the longitude and latitude of the position to query.
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or
* longitude; the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude
* -123.1174
and latitude 49.2847
.
*/
public java.util.List getPosition() {
return position;
}
/**
*
* Specifies the longitude and latitude of the position to query.
*
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the
* second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
and
* latitude 49.2847
.
*
*
* @param position
* Specifies the longitude and latitude of the position to query.
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude;
* the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
* and latitude 49.2847
.
*/
public void setPosition(java.util.Collection position) {
if (position == null) {
this.position = null;
return;
}
this.position = new java.util.ArrayList(position);
}
/**
*
* Specifies the longitude and latitude of the position to query.
*
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the
* second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
and
* latitude 49.2847
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPosition(java.util.Collection)} or {@link #withPosition(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param position
* Specifies the longitude and latitude of the position to query.
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude;
* the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
* and latitude 49.2847
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchPlaceIndexForPositionRequest withPosition(Double... position) {
if (this.position == null) {
setPosition(new java.util.ArrayList(position.length));
}
for (Double ele : position) {
this.position.add(ele);
}
return this;
}
/**
*
* Specifies the longitude and latitude of the position to query.
*
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the
* second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
and
* latitude 49.2847
.
*
*
* @param position
* Specifies the longitude and latitude of the position to query.
*
* This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude;
* the second number represents the Y coordinate, or latitude.
*
*
* For example, [-123.1174, 49.2847]
represents a position with longitude -123.1174
* and latitude 49.2847
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchPlaceIndexForPositionRequest withPosition(java.util.Collection position) {
setPosition(position);
return this;
}
/**
*
* An optional parameter. The maximum number of results returned per request.
*
*
* Default value: 50
*
*
* @param maxResults
* An optional parameter. The maximum number of results returned per request.
*
* Default value: 50
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* An optional parameter. The maximum number of results returned per request.
*
*
* Default value: 50
*
*
* @return An optional parameter. The maximum number of results returned per request.
*
* Default value: 50
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* An optional parameter. The maximum number of results returned per request.
*
*
* Default value: 50
*
*
* @param maxResults
* An optional parameter. The maximum number of results returned per request.
*
* Default value: 50
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchPlaceIndexForPositionRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for English.
*
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the result.
*
*
* For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
* language
parameter set to en
. The city
in the results will most likely be
* returned as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the city
in the
* results will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider does
* support.
*
*
* @param language
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for
* English.
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the
* result.
*
*
* For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
* language
parameter set to en
. The city
in the results will most
* likely be returned as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the city
* in the results will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider
* does support.
*/
public void setLanguage(String language) {
this.language = language;
}
/**
*
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for English.
*
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the result.
*
*
* For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
* language
parameter set to en
. The city
in the results will most likely be
* returned as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the city
in the
* results will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider does
* support.
*
*
* @return The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for
* English.
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the
* result.
*
*
* For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
* language
parameter set to en
. The city
in the results will most
* likely be returned as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the city
* in the results will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider
* does support.
*/
public String getLanguage() {
return this.language;
}
/**
*
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for English.
*
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the result.
*
*
* For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
* language
parameter set to en
. The city
in the results will most likely be
* returned as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the city
in the
* results will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider does
* support.
*
*
* @param language
* The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en
for
* English.
*
* This setting affects the languages used in the results, but not the results themselves. If no language is
* specified, or not supported for a particular result, the partner automatically chooses a language for the
* result.
*
*
* For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
* language
parameter set to en
. The city
in the results will most
* likely be returned as Athens
.
*
*
* If you set the language
parameter to el
, for Greek, then the city
* in the results will more likely be returned as Αθήνα
.
*
*
* If the data provider does not have a value for Greek, the result will be in a language that the provider
* does support.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchPlaceIndexForPositionRequest withLanguage(String language) {
setLanguage(language);
return this;
}
/**
*
* The optional API key
* to authorize the request.
*
*
* @param key
* The optional API
* key to authorize the request.
*/
public void setKey(String key) {
this.key = key;
}
/**
*
* The optional API key
* to authorize the request.
*
*
* @return The optional API
* key to authorize the request.
*/
public String getKey() {
return this.key;
}
/**
*
* The optional API key
* to authorize the request.
*
*
* @param key
* The optional API
* key to authorize the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchPlaceIndexForPositionRequest withKey(String key) {
setKey(key);
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 (getIndexName() != null)
sb.append("IndexName: ").append(getIndexName()).append(",");
if (getPosition() != null)
sb.append("Position: ").append("***Sensitive Data Redacted***").append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getLanguage() != null)
sb.append("Language: ").append(getLanguage()).append(",");
if (getKey() != null)
sb.append("Key: ").append("***Sensitive Data Redacted***");
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SearchPlaceIndexForPositionRequest == false)
return false;
SearchPlaceIndexForPositionRequest other = (SearchPlaceIndexForPositionRequest) obj;
if (other.getIndexName() == null ^ this.getIndexName() == null)
return false;
if (other.getIndexName() != null && other.getIndexName().equals(this.getIndexName()) == false)
return false;
if (other.getPosition() == null ^ this.getPosition() == null)
return false;
if (other.getPosition() != null && other.getPosition().equals(this.getPosition()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getLanguage() == null ^ this.getLanguage() == null)
return false;
if (other.getLanguage() != null && other.getLanguage().equals(this.getLanguage()) == false)
return false;
if (other.getKey() == null ^ this.getKey() == null)
return false;
if (other.getKey() != null && other.getKey().equals(this.getKey()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIndexName() == null) ? 0 : getIndexName().hashCode());
hashCode = prime * hashCode + ((getPosition() == null) ? 0 : getPosition().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getLanguage() == null) ? 0 : getLanguage().hashCode());
hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode());
return hashCode;
}
@Override
public SearchPlaceIndexForPositionRequest clone() {
return (SearchPlaceIndexForPositionRequest) super.clone();
}
}