Class SuggestResult

java.lang.Object
com.cercalia.sdk.model.suggest.SuggestResult

public final class SuggestResult extends Object
Normalized suggestion result from Cercalia Suggest API.

A suggestion represents a potential match for a partial search string, which can be an address, a city, a POI, etc. Use getDisplayText() for the user-facing string and getId() for further detailed queries.

Example usage:


 SuggestResult suggestion = results.get(0);
 System.out.println("Suggestion: " + suggestion.getDisplayText());
 if (suggestion.getCoord() != null) {
     System.out.println("Location: " + suggestion.getCoord());
 }
 
  • Method Details

    • builder

      public static SuggestResult.Builder builder()
    • getId

      @NotNull public @NotNull String getId()
      Returns:
      Unique identifier for the suggestion.
    • getDisplayText

      @NotNull public @NotNull String getDisplayText()
      Returns:
      Formatted text intended to be displayed to the user.
    • getType

      @NotNull public @NotNull SuggestResultType getType()
      Returns:
      The type of the suggestion.
    • getStreet

      @Nullable public @Nullable SuggestStreet getStreet()
      Returns:
      Street information.
    • getCity

      @Nullable public @Nullable SuggestCity getCity()
      Returns:
      Locality information.
    • getPostalCode

      @Nullable public @Nullable String getPostalCode()
      Returns:
      Postal code.
    • getMunicipality

      @Nullable public @Nullable SuggestAdminEntity getMunicipality()
      Returns:
      Municipality details.
    • getSubregion

      @Nullable public @Nullable SuggestAdminEntity getSubregion()
      Returns:
      Subregion details.
    • getRegion

      @Nullable public @Nullable SuggestAdminEntity getRegion()
      Returns:
      Region details.
    • getCountry

      @Nullable public @Nullable SuggestAdminEntity getCountry()
      Returns:
      Country details.
    • getCoord

      @Nullable public @Nullable Coordinate getCoord()
      Returns:
      Geographic coordinates.
    • getHouseNumbers

      @Nullable public @Nullable SuggestHouseNumbers getHouseNumbers()
      Returns:
      House number details.
    • getPoi

      @Nullable public @Nullable SuggestPoi getPoi()
      Returns:
      POI details.
    • getIsOfficial

      @Nullable public @Nullable Boolean getIsOfficial()
      Returns:
      Whether the suggestion is official.
    • getScore

      @Nullable public @Nullable Double getScore()
      Returns:
      Match score (0.0 to 100).