Class ImmutableMapAdapter<K,​V>

  • All Implemented Interfaces:
    com.google.gson.JsonDeserializer<com.google.common.collect.ImmutableMap<K,​V>>, JsonAdapter

    @AutoService(JsonAdapter.class)
    public class ImmutableMapAdapter<K,​V>
    extends Object
    implements com.google.gson.JsonDeserializer<com.google.common.collect.ImmutableMap<K,​V>>, JsonAdapter
    Since:
    1.1.0
    Author:
    Tony Chemit - dev@tchemit.fr
    • Constructor Detail

      • ImmutableMapAdapter

        public ImmutableMapAdapter()
    • Method Detail

      • mapOf

        public static <K,​V> com.google.common.reflect.TypeToken<Map<K,​V>> mapOf​(com.google.common.reflect.TypeToken<K> keyType,
                                                                                            com.google.common.reflect.TypeToken<V> valueType)
      • deserialize

        public com.google.common.collect.ImmutableMap<K,​V> deserialize​(com.google.gson.JsonElement json,
                                                                             Type type,
                                                                             com.google.gson.JsonDeserializationContext context)
                                                                      throws com.google.gson.JsonParseException
        Specified by:
        deserialize in interface com.google.gson.JsonDeserializer<K>
        Throws:
        com.google.gson.JsonParseException