Class CollectionTypeAdapterFactory.Adapter<E>

    • Field Detail

      • elementTypeAdapter

        private final TypeAdapter<E> elementTypeAdapter
      • constructor

        private final ObjectConstructor<? extends java.util.Collection<E>> constructor
    • Constructor Detail

      • Adapter

        public Adapter​(Gson context,
                       java.lang.reflect.Type elementType,
                       TypeAdapter<E> elementTypeAdapter,
                       ObjectConstructor<? extends java.util.Collection<E>> constructor)
    • Method Detail

      • read

        public java.util.Collection<E> read​(JsonReader in)
                                     throws java.io.IOException
        Description copied from class: TypeAdapter
        Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object. Returns the converted object.
        Specified by:
        read in class TypeAdapter<java.util.Collection<E>>
        Returns:
        the converted Java object. May be null.
        Throws:
        java.io.IOException
      • write

        public void write​(JsonWriter out,
                          java.util.Collection<E> collection)
                   throws java.io.IOException
        Description copied from class: TypeAdapter
        Writes one JSON value (an array, object, string, number, boolean or null) for value.
        Specified by:
        write in class TypeAdapter<java.util.Collection<E>>
        collection - the Java object to write. May be null.
        Throws:
        java.io.IOException