All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.seiko.imageloader.component.mapper.KtorUrlMapper.kt Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
package com.seiko.imageloader.component.mapper

import com.seiko.imageloader.option.Options
import io.ktor.http.Url

class KtorUrlMapper : Mapper {
    override fun map(data: Any, options: Options): Url? {
        if (data !is String) return null
        if (!isApplicable(data)) return null
        return Url(data)
    }

    private fun isApplicable(data: String): Boolean {
        return data.startsWith("http")
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy