1 package net.mograsim.logic.model.snippets.highlevelstatehandlers;
3 import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
4 import net.mograsim.logic.model.serializing.IdentifyParams;
5 import net.mograsim.logic.model.snippets.HighLevelStateHandler;
6 import net.mograsim.logic.model.snippets.SnippetDefinintion;
7 import net.mograsim.logic.model.snippets.SubmodelComponentSnippetSuppliers;
9 public class DefaultHighLevelStateHandler implements HighLevelStateHandler
11 public DefaultHighLevelStateHandler()
16 public DefaultHighLevelStateHandler(SubmodelComponent component)
18 this(component, null);
21 @SuppressWarnings("unused") // we don't need the component; and params are always null
22 public DefaultHighLevelStateHandler(SubmodelComponent component, Void params)
28 public Object getHighLevelState(String stateID)
30 throw new IllegalArgumentException("No high level state with ID " + stateID);
34 public void setHighLevelState(String stateID, Object newState)
36 throw new IllegalArgumentException("No high level state with ID " + stateID);
40 public String getIDForSerializing(IdentifyParams idParams)
46 public Void getParamsForSerializing(IdentifyParams idParams)
53 SubmodelComponentSnippetSuppliers.highLevelStateHandlerSupplier.setSnippetSupplier(
54 DefaultHighLevelStateHandler.class.getCanonicalName(),
55 SnippetDefinintion.create(Void.class, DefaultHighLevelStateHandler::new));