Class DateAdapter

java.lang.Object
com.google.gson.TypeAdapter<Date>
com.suse.salt.netapi.parser.DateAdapter

public class DateAdapter extends com.google.gson.TypeAdapter<Date>
TypeAdapter for date representation received from the API (which represents it as a (floating) number of seconds since the Epoch).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read(com.google.gson.stream.JsonReader jsonReader)
     
    void
    write(com.google.gson.stream.JsonWriter jsonWriter, Date date)
     

    Methods inherited from class com.google.gson.TypeAdapter

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

    Methods inherited from class Object

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

    • DateAdapter

      public DateAdapter()
  • Method Details

    • write

      public void write(com.google.gson.stream.JsonWriter jsonWriter, Date date) throws IOException
      Specified by:
      write in class com.google.gson.TypeAdapter<Date>
      Throws:
      IOException
    • read

      public Date read(com.google.gson.stream.JsonReader jsonReader) throws IOException
      Specified by:
      read in class com.google.gson.TypeAdapter<Date>
      Throws:
      IOException