package com.gh.gamecenter.room.converter

import androidx.room.TypeConverter
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.feature.entity.ThumbnailEntity

class ThumbnailConverter {
    @TypeConverter
    fun toThumbnailString(data: ThumbnailEntity?): String {
        return data?.toJson() ?: ""
    }

    @TypeConverter
    fun toThumbnailEntity(token: String?): ThumbnailEntity {
        return token?.toObject() ?: ThumbnailEntity()
    }
}