"""
Python module generated from Java source file com.google.gson.internal.bind.ObjectTypeAdapter

Java source file obtained from artifact gson version 2.8.0

Because this Python module is automatically generated, it may contain errors
and/or code that cannot be parsed. Please report these issues at
https://github.com/magicmq/docs-translator/issues
"""
from com.google.gson import Gson
from com.google.gson import TypeAdapter
from com.google.gson import TypeAdapterFactory
from com.google.gson.internal import LinkedTreeMap
from com.google.gson.internal.bind import *
from com.google.gson.reflect import TypeToken
from com.google.gson.stream import JsonReader
from com.google.gson.stream import JsonToken
from com.google.gson.stream import JsonWriter
from java.io import IOException
from typing import Any, Callable, Iterable, Tuple


class ObjectTypeAdapter(TypeAdapter):
    """
    Adapts types whose static type is only 'Object'. Uses getClass() on
    serialization and a primitive/Map/List on deserialization.
    """

    FACTORY = TypeAdapterFactory() {
    
        @SuppressWarnings("unchecked")
        @Override
        public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
            if (type.getRawType() == Object.class) {
                return (TypeAdapter<T>) ObjectTypeAdapter(gson);
            }
            return null;
        }
    }


    def read(self, in: "JsonReader") -> "Object":
        ...


    def write(self, out: "JsonWriter", value: "Object") -> None:
        ...
