as<T> method

T as<T>()

Casts value to T. An exception will be thrown if the value is not convertible to T.

Implementation

T as<T>() => value as T;