Class Timestamp.Serializer

  • All Implemented Interfaces:
    com.google.gson.JsonSerializer<Timestamp>
    Enclosing class:
    Timestamp

    public static class Timestamp.Serializer
    extends Object
    implements com.google.gson.JsonSerializer<Timestamp>
    Serializer to convert Timestamp to JSON
    • Constructor Detail

      • Serializer

        public Serializer()
    • Method Detail

      • serialize

        public com.google.gson.JsonElement serialize​(Timestamp src,
                                                     Type typeOfSrc,
                                                     com.google.gson.JsonSerializationContext context)
        Serializes a Timestamp to JSON
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<Timestamp>
        Parameters:
        src - The Timestamp to convert
        typeOfSrc - The Type to use
        context - The JsonSerializationContext to use
        Returns:
        A JsonElement containing the Timestamp data