ensureAccessToState

protected void ensureAccessToState()

Ensures that the callee is allowed to access Entity's state() method.

In case the access is prohibited, throws a RuntimeException.

In some scenarios, the state of Entity may be not up-to-date, so descendants of AbstractEntity are able to put the corresponding restrictions on this method invocation.

By default, this method performs no checks, thus allowing to access Entity's state() at any point of time.