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

commonMain.maryk.test.models.SimpleMarykObject.kt Maven / Gradle / Ivy

Go to download

Maryk is a Kotlin Multiplatform library which helps you to store, query and send data in a structured way over multiple platforms. The data store stores any value with a version, so it is possible to request only the changed data or live listen for updates.

The newest version!
package maryk.test.models

import maryk.core.models.ObjectDataModel
import maryk.core.properties.definitions.string
import maryk.core.values.ObjectValues

data class SimpleMarykObject(
    val value: String = "haha"
) {
    companion object : ObjectDataModel(SimpleMarykObject::class) {
        val value by string(
            index = 1u,
            getter = SimpleMarykObject::value,
            default = "haha",
            regEx = "ha.*"
        )

        override fun invoke(values: ObjectValues) = SimpleMarykObject(
            value = values(value.index)
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy