Class DurationConverter

  • All Implemented Interfaces:
    com.google.gson.JsonDeserializer<Duration>, com.google.gson.JsonSerializer<Duration>

    public class DurationConverter
    extends Object
    implements com.google.gson.JsonSerializer<Duration>, com.google.gson.JsonDeserializer<Duration>
    Json <-> Duration converter.
    Since:
    1.5.0
    Author:
    bence.agocsi-kiss
    • Constructor Detail

      • DurationConverter

        public DurationConverter()
        Default constructor, constructs a new object.
    • Method Detail

      • serialize

        public com.google.gson.JsonElement serialize​(Duration duration,
                                                     Type type,
                                                     com.google.gson.JsonSerializationContext jsonSerializationContext)
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<Duration>
      • deserialize

        public Duration deserialize​(com.google.gson.JsonElement jsonElement,
                                    Type type,
                                    com.google.gson.JsonDeserializationContext jsonDeserializationContext)
        Specified by:
        deserialize in interface com.google.gson.JsonDeserializer<Duration>