com.avito.report.serialize.ReportSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of report-api Show documentation
Show all versions of report-api Show documentation
Collection of infrastructure libraries and gradle plugins of Avito Android project
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()