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.ZonedDateTime read​(com.google.gson.stream.JsonReader reader)
    Read a Time object from a Directions API result and convert it to a ZonedDateTime.
    void write​(com.google.gson.stream.JsonWriter writer, java.time.ZonedDateTime value)
    This method is not implemented.

    Methods inherited from class com.google.gson.TypeAdapter

    fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • read

      public java.time.ZonedDateTime read​(com.google.gson.stream.JsonReader reader) throws java.io.IOException
      Read a Time object from a Directions API result and convert it to a ZonedDateTime.

      We are expecting to receive something akin to the following:

       {
         "text" : "4:27pm",
         "time_zone" : "Australia/Sydney",
         "value" : 1406528829
       }
       
      Specified by:
      read in class com.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.IOException
      This method is not implemented.
      Specified by:
      write in class com.google.gson.TypeAdapter<java.time.ZonedDateTime>
      Throws:
      java.io.IOException