as

open fun <U : T> as(): U?

Casts the current object to U, if possible, or returns null otherwise

Return

the current object, casted to U, or null, if the current object is not an instance of U