com.cookingfox.lapasse.api.state.manager.StateManager Maven / Gradle / Ivy
package com.cookingfox.lapasse.api.state.manager;
import com.cookingfox.lapasse.api.event.Event;
import com.cookingfox.lapasse.api.lifecycle.Disposable;
import com.cookingfox.lapasse.api.state.State;
import com.cookingfox.lapasse.api.state.observer.StateObserver;
/**
* Manages the state object.
*
* @param The concrete type of the state object.
*/
public interface StateManager extends Disposable, StateObserver {
/**
* Validate and set a new state object. Notifies listeners if the new state is different from
* the previous state.
*
* @param newState The new state object to set.
* @param event The event that triggered the state change.
*/
void handleNewState(S newState, Event event);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy