Castable

interface Castable<T : Castable<T>>

A type for all object which can be down-casted via explicit methods

Functions

Link copied to clipboard
open fun <U : T> as(): U?

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

Link copied to clipboard
open fun <U : T> castTo(): U

Down-casts the current object to U, if possible