public abstract class GeocodingResponse
extends java.lang.Object
implements java.io.Serializable
CarmenFeature
, the response simply returns a list of those
features.Modifier and Type | Class and Description |
---|---|
static class |
GeocodingResponse.Builder
This builder can be used to set the values describing the
GeocodingResponse . |
Constructor and Description |
---|
GeocodingResponse() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
attribution()
A string attributing the results of the Mapbox Geocoding API to Mapbox and links to Mapbox's
terms of service and data sources.
|
static GeocodingResponse.Builder |
builder()
Create a new instance of this class by using the
GeocodingResponse.Builder class. |
abstract java.util.List<CarmenFeature> |
features()
A list of the CarmenFeatures which contain the results and are ordered from most relevant to
least.
|
static GeocodingResponse |
fromJson(java.lang.String json)
Create a new instance of this class by passing in a formatted valid JSON String.
|
abstract java.util.List<java.lang.String> |
query()
A list of space and punctuation-separated strings from the original query.
|
abstract GeocodingResponse.Builder |
toBuilder()
Convert the current
GeocodingResponse to its builder holding the currently assigned
values. |
java.lang.String |
toJson()
This takes the currently defined values found inside this instance and converts it to a GeoJson
string.
|
abstract java.lang.String |
type()
A geocoding response will always be an extension of a
FeatureCollection containing
additional information. |
static com.google.gson.TypeAdapter<GeocodingResponse> |
typeAdapter(com.google.gson.Gson gson)
Gson TYPE adapter for parsing Gson to this class.
|
@NonNull public static GeocodingResponse fromJson(@NonNull java.lang.String json)
json
- a formatted valid JSON string defining a GeoJson Geocoding Response@NonNull public static GeocodingResponse.Builder builder()
GeocodingResponse.Builder
class.GeocodingResponse.Builder
for creating a new instance@NonNull public abstract java.lang.String type()
FeatureCollection
containing
additional information.@NonNull public abstract java.util.List<java.lang.String> query()
@NonNull public abstract java.util.List<CarmenFeature> features()
CarmenFeature
s which each represent an individual result from the
query@NonNull public abstract java.lang.String attribution()
@NonNull public abstract GeocodingResponse.Builder toBuilder()
GeocodingResponse
to its builder holding the currently assigned
values. This allows you to modify a single variable and then rebuild the object resulting in
an updated and modified GeocodingResponse
.GeocodingResponse.Builder
with the same values set to match the ones defined
in this GeocodingResponse
@NonNull public java.lang.String toJson()
public static com.google.gson.TypeAdapter<GeocodingResponse> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
object