as
Casts the wrapped event to the specified class if possible.
This method initializes the underlying event if it hasn't been created yet.
Return
the cast event, or null if the cast is not possible
Since
2.0.0
Parameters
eventClass
the class to cast to
<T>
the type of the event
open fun <T : ModelEvent?> as(@NotNull eventClass: @NotNull Class<T>, @NotNull consumer: @NotNull Consumer<in T>)
Executes a consumer if the wrapped event is of the specified type.
Since
2.0.0
Parameters
eventClass
the class to check against
consumer
the consumer to execute
<T>
the type of the event