realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

Add support for RealmAny

Open edualonso opened this issue 3 years ago • 0 comments

The API should look something like this:

interface RealmAny {

    val type: Type

    fun asInt(): Int
    fun <T: RealmObject> asRealmObject(clazz: KClass<T>): T
    fun isNull(): boolean
    // etc.

    enum class Type {
        INT, OBJECT, NULL // etc.
    }

    companion object {
        fun valueOf(value: Int?): RealmAny = TODO()
        fun valueOf(value: RealmObject): RealmAny = TODO()
        fun nullValue(): RealmAny = TODO()
        // etc.
    }
}

Observations: TBD

edualonso avatar Nov 04 '21 11:11 edualonso