fun processMethod()

in core/src/main/java/com/epam/coroutinecache/internal/ProxyTranslator.kt [22:40]


    fun processMethod(method: Method?, methodArgs: Array<out Any>?): CacheObjectParams? {
        if (method == null) {
            return null
        }
        val cacheObjectParams = CacheObjectParams()
        val lifeTime = getMethodLifeTime(method)
        if (lifeTime != null) {
            cacheObjectParams.lifeTime = lifeTime.first
            cacheObjectParams.timeUnit = lifeTime.second
        }
        cacheObjectParams.isExpirable = isMethodExpirable(method)
        cacheObjectParams.useIfExpired = useMethodIfExpired(method)
        cacheObjectParams.dataProvider = getDataSuspend(method, methodArgs)
        val baseKey = getMethodKey(method)
        cacheObjectParams.key = cacheObjectParams.dataProvider?.parameterizeKey(baseKey) ?: baseKey
        cacheObjectParams.entryType = getMethodType(method)

        return cacheObjectParams
    }