All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avito.report.serialize.ReportSerializer.kt Maven / Gradle / Ivy

Go to download

Collection of infrastructure libraries and gradle plugins of Avito Android project

There is a newer version: 2023.22
Show newest version
package com.avito.report.serialize

import com.avito.android.Result
import com.avito.report.model.FileAddress
import com.avito.report.model.TestRuntimeData
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import java.io.File

public interface ReportSerializer {

    public fun serialize(testRuntimeData: TestRuntimeData, reportFile: File): Result

    public fun deserialize(reportFile: File): Result
}

public fun ReportSerializer(): ReportSerializer = GsonReportSerializer(gson = createReportGson())

public fun createReportGson(): Gson = GsonBuilder()
    .registerTypeAdapterFactory(EntryTypeAdapterFactory())
    .registerTypeAdapter(FileAddress::class.java, FileAddressTypeAdapter())
    .create()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy