/* * 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 a place suggestion resulting from a place suggestion query that is * run on a place index resource. *

*/ public class SearchForSuggestionsResult implements Serializable { /** *

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

* 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. *

*
*/ private String placeId; /** *

* Categories from the data provider that describe the Place that are not * mapped to any Amazon Location categories. *

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

* 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 getCategories() { return categories; } /** *

* 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. *

* * @param categories

* 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 void setCategories(java.util.Collection categories) { if (categories == null) { this.categories = null; return; } this.categories = new java.util.ArrayList(categories); } /** *

* 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. *

*

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

* 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 A reference to this updated object so that method calls can be * chained together. */ public SearchForSuggestionsResult withCategories(String... categories) { if (getCategories() == null) { this.categories = new java.util.ArrayList(categories.length); } for (String value : categories) { this.categories.add(value); } return this; } /** *

* 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. *

*

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

* 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 A reference to this updated object so that method calls can be * chained together. */ public SearchForSuggestionsResult withCategories(java.util.Collection categories) { setCategories(categories); return this; } /** *

* 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. *

*
* * @return

* 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. *

*
*/ public String getPlaceId() { return placeId; } /** *

* 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. *

*
* * @param placeId

* 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. *

*
*/ public void setPlaceId(String placeId) { this.placeId = placeId; } /** *

* 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. *

*
*

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

* 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. *

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

* 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 getSupplementalCategories() { return supplementalCategories; } /** *

* 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 supplementalCategories) { if (supplementalCategories == null) { this.supplementalCategories = null; return; } this.supplementalCategories = new java.util.ArrayList(supplementalCategories); } /** *

* Categories from the data provider that describe the Place that are not * mapped to any Amazon Location categories. *

*

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

* Categories from the data provider that describe the Place that * are not mapped to any Amazon Location categories. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SearchForSuggestionsResult withSupplementalCategories(String... supplementalCategories) { if (getSupplementalCategories() == null) { this.supplementalCategories = new java.util.ArrayList( supplementalCategories.length); } for (String value : supplementalCategories) { this.supplementalCategories.add(value); } return this; } /** *

* Categories from the data provider that describe the Place that are not * mapped to any Amazon Location categories. *

*

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

* Categories from the data provider that describe the Place that * are not mapped to any Amazon Location categories. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SearchForSuggestionsResult withSupplementalCategories( java.util.Collection supplementalCategories) { setSupplementalCategories(supplementalCategories); return this; } /** *

* 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 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. *

*/ public void setText(String text) { this.text = text; } /** *

* The text of the place suggestion, typically formatted as an address * string. *

*

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

* The text of the place suggestion, typically formatted as an * address string. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SearchForSuggestionsResult withText(String text) { this.text = text; 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 (getCategories() != null) sb.append("Categories: " + getCategories() + ","); if (getPlaceId() != null) sb.append("PlaceId: " + getPlaceId() + ","); if (getSupplementalCategories() != null) sb.append("SupplementalCategories: " + getSupplementalCategories() + ","); if (getText() != null) sb.append("Text: " + getText()); sb.append("}"); return sb.toString(); } @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 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; } }