package dev.adriankuta.flights.model.data.shared

import dev.adriankuta.flights.model.datasource.shared.Cache

data class CacheImpl<T>(override val cacheKey: String?, override val data: T?) :
    Cache<T> {
    companion object {
        inline fun <reified T> emptyCache(): CacheImpl<T> =
            CacheImpl(null, null)

        inline fun <reified T> Cache<T>?.orEmpty(): Cache<T> =
            this ?: emptyCache()
    }
}
