Class OrderingMapSerializer

  • All Implemented Interfaces:
    com.google.gson.JsonSerializer<Map<@Nullable Object,​@Nullable Object>>

    @NonNullByDefault
    public class OrderingMapSerializer
    extends Object
    implements com.google.gson.JsonSerializer<Map<@Nullable Object,​@Nullable Object>>
    Serializes map data by ordering the keys
    Author:
    Sami Salonen - Initial contribution
    • Constructor Detail

      • OrderingMapSerializer

        public OrderingMapSerializer()
    • Method Detail

      • serialize

        public com.google.gson.JsonElement serialize​(Map<@Nullable Object,​@Nullable Object> src,
                                                     Type typeOfSrc,
                                                     com.google.gson.JsonSerializationContext context)
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<Map<@Nullable Object,​@Nullable Object>>