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

se.ansman.dagger.auto.compiler.common.Anys.kt Maven / Gradle / Ivy

The newest version!
package se.ansman.dagger.auto.compiler.common

fun  T.applyEach(iterable: Iterable, block: T.(E) -> Unit): T = apply {
    for (element in iterable) {
        block(element)
    }
}

fun  T.applyEachIndexed(iterable: Iterable, block: T.(index: Int, E) -> Unit): T = apply {
    iterable.forEachIndexed { i, e -> block(i, e) }
}

fun  T.applyIf(predicate: Boolean, block: T.() -> Unit): T = apply {
    if (predicate) {
        block()
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy