-
Notifications
You must be signed in to change notification settings - Fork 0
Allow configuring a command to be run on entering state #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
d4c9754 to
a2cc083
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a guava MultiMap instead? Is there a reason we can't have multiple state commands for each state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCommandForBinding() is here so it provides a more helpful error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between this and just setting the map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we want to add more later
ca0d840 to
b2a5cef
Compare
| Command stateCommand = getCommandForBinding(commandEntry.getValue()); | ||
| stateCommands.put(commandEntry.getKey(), stateCommand); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably take a MultiMap. I think there's a Multimaps.newMultiMap method which can convert a map to a multimap. Or you could just use https://github.com/FasterXML/jackson-datatypes-collections and have a Multimap in the config
| logger.debug("Starting stepper"); | ||
| stepper.start(); | ||
|
|
||
| autoCommand = commandStore.getCommand("AutoInit"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You remove this here, but you never add it to the config
8b3da0e to
45d3543
Compare
Appears to be done
b90bcec to
fc0892c
Compare
No description provided.