Class ImmutableListDeserializer

java.lang.Object
com.github.natche.gravatarjavaclient.profile.gson.BaseCollectionDeserializer<com.google.common.collect.ImmutableList<?>>
com.github.natche.gravatarjavaclient.profile.gson.ImmutableListDeserializer
All Implemented Interfaces:
com.google.gson.JsonDeserializer<com.google.common.collect.ImmutableList<?>>

public final class ImmutableListDeserializer extends BaseCollectionDeserializer<com.google.common.collect.ImmutableList<?>>
A collection deserializer for Gson to use when deserializing a Collection into an ImmutableList from Guava.
  • Constructor Details

    • ImmutableListDeserializer

      public ImmutableListDeserializer()
  • Method Details

    • buildFrom

      protected com.google.common.collect.ImmutableList<?> buildFrom(Collection<?> collection)
      Deserializes a collection into an ImmutableList.
      Specified by:
      buildFrom in class BaseCollectionDeserializer<com.google.common.collect.ImmutableList<?>>
      Parameters:
      collection - the collection to deserialize.
      Returns:
      a new ImmutableList containing the elements of the provided collection