package com.gh.gamecenter.feature.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.SectionEntity

class SectionConverter {
    @TypeConverter
    fun toSectionEntityString(data: List<SectionEntity>?): String {
        return data?.toJson() ?: ""
    }

    @TypeConverter
    fun toSectionEntity(token: String?): List<SectionEntity> {
        return token?.toObject() ?: arrayListOf()
    }
}
