Package ai.nextbillion.maps.internal
Class ZonedDateTimeAdapter
java.lang.Object
com.google.gson.TypeAdapter<java.time.ZonedDateTime>
ai.nextbillion.maps.internal.ZonedDateTimeAdapter
public class ZonedDateTimeAdapter
extends com.google.gson.TypeAdapter<java.time.ZonedDateTime>
This class handles conversion from JSON to
ZonedDateTimes.
Please see TypeAdapter for more detail.
-
Constructor Summary
Constructors Constructor Description ZonedDateTimeAdapter() -
Method Summary
Modifier and Type Method Description java.time.ZonedDateTimeread(com.google.gson.stream.JsonReader reader)Read a Time object from a Directions API result and convert it to aZonedDateTime.voidwrite(com.google.gson.stream.JsonWriter writer, java.time.ZonedDateTime value)This method is not implemented.
-
Constructor Details
-
ZonedDateTimeAdapter
public ZonedDateTimeAdapter()
-
-
Method Details
-
read
public java.time.ZonedDateTime read(com.google.gson.stream.JsonReader reader) throws java.io.IOExceptionRead a Time object from a Directions API result and convert it to aZonedDateTime.We are expecting to receive something akin to the following:
{ "text" : "4:27pm", "time_zone" : "Australia/Sydney", "value" : 1406528829 }- Specified by:
readin classcom.google.gson.TypeAdapter<java.time.ZonedDateTime>- Throws:
java.io.IOException
-
write
public void write(com.google.gson.stream.JsonWriter writer, java.time.ZonedDateTime value) throws java.io.IOExceptionThis method is not implemented.- Specified by:
writein classcom.google.gson.TypeAdapter<java.time.ZonedDateTime>- Throws:
java.io.IOException
-