commonMain.com.seiko.imageloader.component.ComponentRegistryBuilder.kt Maven / Gradle / Ivy
package com.seiko.imageloader.component
import com.seiko.imageloader.component.decoder.Decoder
import com.seiko.imageloader.component.fetcher.Fetcher
import com.seiko.imageloader.component.keyer.Keyer
import com.seiko.imageloader.component.mapper.Mapper
class ComponentRegistryBuilder(
private val mappers: MutableList> = mutableListOf(),
private val keyers: MutableList = mutableListOf(),
private val fetcherFactories: MutableList = mutableListOf(),
private val decoderFactories: MutableList = mutableListOf(),
) {
fun add(mapper: Mapper) {
mappers.add(mapper)
}
fun add(keyer: Keyer) {
keyers.add(keyer)
}
fun add(fetcherFactory: Fetcher.Factory) {
fetcherFactories.add(fetcherFactory)
}
fun add(decoderFactory: Decoder.Factory) {
decoderFactories.add(decoderFactory)
}
fun build(): ComponentRegistry = ComponentRegistry(
mappers = mappers,
keyers = keyers,
fetcherFactories = fetcherFactories,
decoderFactories = decoderFactories,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy