io.smooth.constraint.resolution.ConstraintResolutionBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of constraints Show documentation
Show all versions of constraints Show documentation
A suite of libraries made to help ease developer's life
The newest version!
package io.smooth.constraint.resolution
import io.smooth.constraint.Constraint
import io.smooth.constraint.ConstraintsService
import javax.inject.Provider
import kotlin.reflect.KClass
suspend inline fun > forConstraint(
block: ConstraintResolutionBuilder.() -> Unit
) {
val builder = ConstraintResolutionBuilder()
block(builder)
ConstraintsService.getInstance().addConstraintsResolutions(
C::class,
builder.getResolutionsProviders()
)
}
class ConstraintResolutionBuilder> {
private val resolutionsProviders: MutableList>> =
arrayListOf()
fun resolution(vararg resolution: Provider>) {
resolutionsProviders.addAll(resolution)
}
fun getResolutionsProviders(): List>> =
resolutionsProviders
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy