package com.lukouguoji.module_base.http.net

import com.google.gson.Gson
import com.google.gson.TypeAdapter
import com.google.gson.TypeAdapterFactory
import com.google.gson.reflect.TypeToken
import com.lukouguoji.module_base.ktx.loge

class NullStringAdapterFactory : TypeAdapterFactory {
    override fun <T : Any?> create(gson: Gson, type: TypeToken<T>): TypeAdapter<T>? {
        if (type.rawType == String::class.java) {
            loge("判定类型为String ")
            return StringTypeAdapter() as TypeAdapter<T>
        }
        return null
    }
}