checkCallerClass

fun checkCallerClass(expected: Class<*>)

Checks if the immediate caller class matches the expected class.

This function verifies that the class of the immediate caller matches the provided expected class. If the caller class does not match, an IllegalStateException is thrown.

Parameters

expected

The Class object representing the expected caller class. This is the class that the function expects to be the direct invoker of the current method.

Throws

If the class of the immediate caller does not match the expected class.