as

@NotNull
open fun <T> as(klass: Class<T>): @NotNull T

Attempt to retrieve the value in the specified format

Return

The value as an instance of the specified class

Parameters

klass

The class to retrieve the value as

Throws

If conversion is impossible