asInt

abstract fun asInt(): Int

Returns the value from this RealmAny as an Int. RealmAny instances created using Short, Int, Byte, Char or Long values can be converted to any of these types safely, although overflow might occur, for example, if the value to be output as a Short is greater than Int.MAX_VALUE.

Throws

if the stored value cannot be safely converted to Int.

if the stored value cannot be coerced to another numeric type.