se.ansman.dagger.auto.compiler.common.Anys.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler-common Show documentation
Show all versions of compiler-common Show documentation
Automatic Dagger setup using Hilt
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