/* * Copyright 2018-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.location.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains a place suggestion resulting from a place suggestion query that is run on a place index resource. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SearchForSuggestionsResult implements Serializable, Cloneable, StructuredPojo { /** ** The Amazon Location categories that describe the Place. *
** For more information about using categories, including a list of Amazon Location categories, see Categories and * filtering, in the Amazon Location Service Developer Guide. *
*/ private java.util.List
* The unique identifier of the Place. You can use this with the GetPlace
operation to find the place
* again later, or to get full information for the Place.
*
* The GetPlace
request must use the same PlaceIndex
resource as the
* SearchPlaceIndexForSuggestions
that generated the Place ID.
*
* For SearchPlaceIndexForSuggestions
operations, the PlaceId
is returned by place indexes
* that use Esri, Grab, or HERE as data providers.
*
* Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories. *
*/ private java.util.List* The text of the place suggestion, typically formatted as an address string. *
*/ private String text; /** ** The Amazon Location categories that describe the Place. *
** For more information about using categories, including a list of Amazon Location categories, see Categories and * filtering, in the Amazon Location Service Developer Guide. *
* * @return The Amazon Location categories that describe the Place. *
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*/
public java.util.List
* The Amazon Location categories that describe the Place.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*/
public void setCategories(java.util.Collection
* The Amazon Location categories that describe the Place.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCategories(java.util.Collection)} or {@link #withCategories(java.util.Collection)} if you want to
* override the existing values.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchForSuggestionsResult withCategories(String... categories) {
if (this.categories == null) {
setCategories(new java.util.ArrayList
* The Amazon Location categories that describe the Place.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
*
* For more information about using categories, including a list of Amazon Location categories, see Categories and
* filtering, in the Amazon Location Service Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchForSuggestionsResult withCategories(java.util.Collection
* The unique identifier of the Place. You can use this with the
* The
* For GetPlace
operation to find the place
* again later, or to get full information for the Place.
* GetPlace
request must use the same PlaceIndex
resource as the
* SearchPlaceIndexForSuggestions
that generated the Place ID.
* SearchPlaceIndexForSuggestions
operations, the PlaceId
is returned by place indexes
* that use Esri, Grab, or HERE as data providers.
* GetPlace
operation to find the
* place again later, or to get full information for the Place.
* The GetPlace
request must use the same PlaceIndex
resource as the
* SearchPlaceIndexForSuggestions
that generated the Place ID.
*
* For SearchPlaceIndexForSuggestions
operations, the PlaceId
is returned by place
* indexes that use Esri, Grab, or HERE as data providers.
*
* The unique identifier of the Place. You can use this with the GetPlace
operation to find the place
* again later, or to get full information for the Place.
*
* The GetPlace
request must use the same PlaceIndex
resource as the
* SearchPlaceIndexForSuggestions
that generated the Place ID.
*
* For SearchPlaceIndexForSuggestions
operations, the PlaceId
is returned by place indexes
* that use Esri, Grab, or HERE as data providers.
*
GetPlace
operation to find the
* place again later, or to get full information for the Place.
*
* The GetPlace
request must use the same PlaceIndex
resource as the
* SearchPlaceIndexForSuggestions
that generated the Place ID.
*
* For SearchPlaceIndexForSuggestions
operations, the PlaceId
is returned by place
* indexes that use Esri, Grab, or HERE as data providers.
*
* The unique identifier of the Place. You can use this with the GetPlace
operation to find the place
* again later, or to get full information for the Place.
*
* The GetPlace
request must use the same PlaceIndex
resource as the
* SearchPlaceIndexForSuggestions
that generated the Place ID.
*
* For SearchPlaceIndexForSuggestions
operations, the PlaceId
is returned by place indexes
* that use Esri, Grab, or HERE as data providers.
*
GetPlace
operation to find the
* place again later, or to get full information for the Place.
*
* The GetPlace
request must use the same PlaceIndex
resource as the
* SearchPlaceIndexForSuggestions
that generated the Place ID.
*
* For SearchPlaceIndexForSuggestions
operations, the PlaceId
is returned by place
* indexes that use Esri, Grab, or HERE as data providers.
*
* Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories. *
* * @return Categories from the data provider that describe the Place that are not mapped to any Amazon Location * categories. */ public java.util.List* Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories. *
* * @param supplementalCategories * Categories from the data provider that describe the Place that are not mapped to any Amazon Location * categories. */ public void setSupplementalCategories(java.util.Collection* Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setSupplementalCategories(java.util.Collection)} or * {@link #withSupplementalCategories(java.util.Collection)} if you want to override the existing values. *
* * @param supplementalCategories * Categories from the data provider that describe the Place that are not mapped to any Amazon Location * categories. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchForSuggestionsResult withSupplementalCategories(String... supplementalCategories) { if (this.supplementalCategories == null) { setSupplementalCategories(new java.util.ArrayList* Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories. *
* * @param supplementalCategories * Categories from the data provider that describe the Place that are not mapped to any Amazon Location * categories. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchForSuggestionsResult withSupplementalCategories(java.util.Collection* The text of the place suggestion, typically formatted as an address string. *
* * @param text * The text of the place suggestion, typically formatted as an address string. */ public void setText(String text) { this.text = text; } /** ** The text of the place suggestion, typically formatted as an address string. *
* * @return The text of the place suggestion, typically formatted as an address string. */ public String getText() { return this.text; } /** ** The text of the place suggestion, typically formatted as an address string. *
* * @param text * The text of the place suggestion, typically formatted as an address string. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchForSuggestionsResult withText(String text) { setText(text); 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 (getCategories() != null) sb.append("Categories: ").append(getCategories()).append(","); if (getPlaceId() != null) sb.append("PlaceId: ").append(getPlaceId()).append(","); if (getSupplementalCategories() != null) sb.append("SupplementalCategories: ").append(getSupplementalCategories()).append(","); if (getText() != null) sb.append("Text: ").append(getText()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchForSuggestionsResult == false) return false; SearchForSuggestionsResult other = (SearchForSuggestionsResult) obj; if (other.getCategories() == null ^ this.getCategories() == null) return false; if (other.getCategories() != null && other.getCategories().equals(this.getCategories()) == false) return false; if (other.getPlaceId() == null ^ this.getPlaceId() == null) return false; if (other.getPlaceId() != null && other.getPlaceId().equals(this.getPlaceId()) == false) return false; if (other.getSupplementalCategories() == null ^ this.getSupplementalCategories() == null) return false; if (other.getSupplementalCategories() != null && other.getSupplementalCategories().equals(this.getSupplementalCategories()) == false) return false; if (other.getText() == null ^ this.getText() == null) return false; if (other.getText() != null && other.getText().equals(this.getText()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCategories() == null) ? 0 : getCategories().hashCode()); hashCode = prime * hashCode + ((getPlaceId() == null) ? 0 : getPlaceId().hashCode()); hashCode = prime * hashCode + ((getSupplementalCategories() == null) ? 0 : getSupplementalCategories().hashCode()); hashCode = prime * hashCode + ((getText() == null) ? 0 : getText().hashCode()); return hashCode; } @Override public SearchForSuggestionsResult clone() { try { return (SearchForSuggestionsResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.location.model.transform.SearchForSuggestionsResultMarshaller.getInstance().marshall(this, protocolMarshaller); } }