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

com.likethesalad.tools.resource.collector.source.ResourceSourceProvider.kt Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package com.likethesalad.tools.resource.collector.source

import com.likethesalad.tools.resource.collector.filter.ResourceSourceFilter
import com.likethesalad.tools.resource.collector.filter.ResourceSourceFilterRule

abstract class ResourceSourceProvider {
    private val filter: ResourceSourceFilter by lazy { ResourceSourceFilter() }

    protected abstract fun doGetSources(): List

    fun getSources(): List {
        return doGetSources().filter { !filter.exclude(it) }
    }

    fun addFilterRules(rules: List>) {
        for (rule in rules) {
            filter.addRule(rule)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy