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

com.yandex.div.dsl.Property.kt Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 30.19.0
Show newest version
package com.yandex.div.dsl

sealed class Property

class ReferenceProperty internal constructor(val name: String) : Property()

sealed class ValueProperty : Property()

class LiteralProperty internal constructor(val value: T): ValueProperty()

class ExpressionProperty internal constructor(val expression: String): ValueProperty()

fun  reference(name: String): ReferenceProperty {
    return ReferenceProperty(name)
}

fun  value(value: T): LiteralProperty {
    return LiteralProperty(value)
}

fun  optionalValue(value: T?): LiteralProperty? {
    return if (value == null) null else LiteralProperty(value)
}

fun  expression(expression: String): ValueProperty {
    return ExpressionProperty(expression)
}

fun int(intValue: Int) = value(intValue)

fun number(numberValue: Double) = value(numberValue)

fun bool(boolValue: Boolean) = value(boolValue)

fun string(stringValue: String) = value(stringValue)

fun > enum(enumValue: E) = value(enumValue)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy