Class MapAdapter

  • All Implemented Interfaces:
    com.google.gson.JsonSerializer<java.util.Map<java.lang.String,​?>>

    @Internal
    public final class MapAdapter
    extends java.lang.Object
    implements com.google.gson.JsonSerializer<java.util.Map<java.lang.String,​?>>
    Serializes maps to JSON. When map is empty or null, returns null.
    • Constructor Summary

      Constructors 
      Constructor Description
      MapAdapter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable com.google.gson.JsonElement serialize​(@Nullable java.util.Map<java.lang.String,​?> src, @NotNull java.lang.reflect.Type typeOfSrc, @NotNull com.google.gson.JsonSerializationContext context)  
      • Methods inherited from class java.lang.Object

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

      • MapAdapter

        public MapAdapter()
    • Method Detail

      • serialize

        @Nullable
        public @Nullable com.google.gson.JsonElement serialize​(@Nullable
                                                               @Nullable java.util.Map<java.lang.String,​?> src,
                                                               @NotNull
                                                               @NotNull java.lang.reflect.Type typeOfSrc,
                                                               @NotNull
                                                               @NotNull com.google.gson.JsonSerializationContext context)
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<java.util.Map<java.lang.String,​?>>