asRealmObject

abstract fun <T : BaseRealmObject> asRealmObject(clazz: KClass<T>): T

Returns the value from this RealmAny as a BaseRealmObject of type T.

Throws

if the stored value cannot be safely converted to T.