State Container
Interface for managing immutable state with validation and thread safety.
StateContainer provides a controlled way to update immutable state objects while ensuring validation rules are enforced and operations are thread-safe.
Parameters
The type of state being managed
Inheritors
Functions
Conditionally updates the state only if the current state matches the expected state.
Updates the state and returns the previous state if successful, or null if failed.
Returns the current state cast to the specified type, or null if not of that type.
Returns true if the current state is of the specified type.
Updates the state and returns the new state if successful, or null if failed.
Extension function for StateContainer to perform atomic updates.
Updates the state using the provided updater function.
Transforms the state using a suspending function while maintaining thread safety.
Validates the given state using the container's validator.