Package com.cercalia.sdk.model.geocoding
Class GeocodingOptions.Builder
java.lang.Object
com.cercalia.sdk.model.geocoding.GeocodingOptions.Builder
- Enclosing class:
- GeocodingOptions
Builder for constructing
GeocodingOptions instances.
Supports both structured search (by address components) and free-form text search.
All setter methods return this for method chaining.
// Structured search
GeocodingOptions options = GeocodingOptions.builder()
.street("Carrer de la Provença")
.locality("Barcelona")
.countryCode("ESP")
.build();
// Free-form search
GeocodingOptions options = GeocodingOptions.builder()
.query("Provença 5, Barcelona")
.fullSearch(true)
.build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a newGeocodingOptionsinstance.Sets the country name.countryCode(String countryCode) Sets the country code (ISO 3166-1).fullSearch(Boolean fullSearch) Enables or disables full search mode.houseNumber(String houseNumber) Sets the house number.Sets the maximum number of results to return.Sets the locality (locality) name.municipality(String municipality) Sets the municipality name.postalCode(String postalCode) Sets the postal code.Sets the free-form text query.Sets the region (state/autonomous community) name.Sets the street name.Sets the subregion (subregion) name.
-
Method Details
-
query
Sets the free-form text query.When set, this takes precedence over structured address components.
- Parameters:
query- the text to search for- Returns:
- this Builder instance for method chaining
-
country
Sets the country name.- Parameters:
country- the full country name- Returns:
- this Builder instance for method chaining
-
countryCode
Sets the country code (ISO 3166-1).Recommended to use 2-letter codes (e.g., "ES") or 3-letter codes (e.g., "ESP"). Default is "ESP" if not specified.
- Parameters:
countryCode- the country code- Returns:
- this Builder instance for method chaining
-
locality
Sets the locality (locality) name.- Parameters:
locality- the locality name- Returns:
- this Builder instance for method chaining
-
municipality
Sets the municipality name.- Parameters:
municipality- the municipality name- Returns:
- this Builder instance for method chaining
-
region
Sets the region (state/autonomous community) name.- Parameters:
region- the region name- Returns:
- this Builder instance for method chaining
-
subregion
Sets the subregion (subregion) name.- Parameters:
subregion- the subregion name- Returns:
- this Builder instance for method chaining
-
street
Sets the street name.- Parameters:
street- the street name- Returns:
- this Builder instance for method chaining
-
postalCode
Sets the postal code.- Parameters:
postalCode- the postal code- Returns:
- this Builder instance for method chaining
-
houseNumber
Sets the house number.- Parameters:
houseNumber- the house number- Returns:
- this Builder instance for method chaining
-
limit
Sets the maximum number of results to return.If not specified, API's default limit is used.
- Parameters:
limit- the maximum number of results (positive integer)- Returns:
- this Builder instance for method chaining
-
fullSearch
Enables or disables full search mode.When enabled, performs a more exhaustive search that may include partial matches and broader results.
- Parameters:
fullSearch- true to enable full search, false otherwise- Returns:
- this Builder instance for method chaining
-
build
Builds and returns a newGeocodingOptionsinstance.- Returns:
- a new GeocodingOptions instance
-