divkit.dsl.core.Resolution.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-json-builder Show documentation
Show all versions of kotlin-json-builder Show documentation
DivKit is an open source Server-Driven UI (SDUI) framework. SDUI is a an emerging technique that leverage the server to build the user interfaces of their mobile app.
package divkit.dsl.core
import kotlin.Any
sealed interface Resolution
class FinalResolution internal constructor(
val reference: ReferenceProperty,
val value: Any,
) : Resolution
class ProxyResolution internal constructor(
val reference: ReferenceProperty,
val proxy: ReferenceProperty,
) : Resolution
infix fun ReferenceProperty.bind(value: T): Resolution = FinalResolution(this, value)
infix fun ReferenceProperty.bind(property: Property): Resolution = when (property) {
is LiteralProperty -> FinalResolution(this, property.value)
is ExpressionProperty -> FinalResolution(this, property.expression)
is ReferenceProperty -> ProxyResolution(this, property)
}