package com.gh.gamecenter.room.converter

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

class IconFloatConverter {
    @TypeConverter
    fun toIconFloatString(data: IconFloat?): String {
        return data?.toJson() ?: ""
    }

    @TypeConverter
    fun toIconFloat(token: String?): IconFloat {
        return token?.toObject() ?: IconFloat()
    }
}
