public class PositionSerializer extends Object implements com.google.gson.JsonSerializer<com.mapbox.services.commons.models.Position>
Constructor and Description |
---|
PositionSerializer() |
Modifier and Type | Method and Description |
---|---|
com.google.gson.JsonElement |
serialize(com.mapbox.services.commons.models.Position src,
Type typeOfSrc,
com.google.gson.JsonSerializationContext context)
Required to handle the special case where the altitude might be a Double.NaN, which isn't a
valid double value as per JSON specification.
|
public com.google.gson.JsonElement serialize(com.mapbox.services.commons.models.Position src, Type typeOfSrc, com.google.gson.JsonSerializationContext context)
serialize
in interface com.google.gson.JsonSerializer<com.mapbox.services.commons.models.Position>
src
- A Position
defined by a longitude, latitude, and optionally, an
altitude.typeOfSrc
- Common superinterface for all types in the Java.context
- Context for deserialization that is passed to a custom deserializer during
invocation of its JsonDeserializer.deserialize(JsonElement, Type,
com.google.gson.JsonDeserializationContext)
method.© 2015–2016 Mapbox. All rights reserved.