getLayerAs

open fun <T : Layer?> getLayerAs(@NonNull layerId: String): T

Tries to cast the Layer to T, throws ClassCastException if it's another type.

Return

the casted Layer, null if another type

Parameters

layerId

the layer id used to look up a layer

<T>

the generic attribute of a Layer