nextEventBody
Retrieves the body of the next event and validates its type using KClass.
This method advances the iterator and returns only the event body, ensuring it is of the expected type.
Return
the body of the next event with the validated type
Parameters
the expected type of the event body
the KClass representing the expected event body type
Throws
if there is no next event or the event type doesn't match
Retrieves the body of the next event and validates its type using Class.
This method advances the iterator and returns only the event body, ensuring it is of the expected type. Java-friendly overload using Class instead of KClass.
Return
the body of the next event with the validated type
Parameters
the expected type of the event body
the Class representing the expected event body type
Throws
if there is no next event or the event type doesn't match
Retrieves the body of the next event with reified type validation.
This inline method uses reified generics to automatically infer the event type, providing a convenient way to get typed event bodies without explicit type parameters.
Return
the body of the next event with the validated type
Parameters
the expected type of the event body (inferred by reification)
Throws
if there is no next event or the event type doesn't match