-
Notifications
You must be signed in to change notification settings - Fork 0
Interaction Framework #19
base: main
Are you sure you want to change the base?
Conversation
*/ | ||
public ButtonAction(String label, ButtonStyle buttonStyle) { | ||
this.params = new ArrayList<>(); | ||
this.label = label; |
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.
Add a check to make sure that the label does not contain the ':'
character. Throw an IllegalArgumentException if so, since this will mess up handling the interaction later on.
* @return the current instance in order to allow chain call methods. | ||
*/ | ||
public ButtonAction addParam(Object param) { | ||
params.add(String.valueOf(param)); |
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.
Same here, check that the param's string representation cannot contain the ':'
symbol. Also it would probably be nicer to just require a String
parameter instead of accepting any object and then converting it into a string. Also this doesn't seem to support the notion of type-checked or named parameters, which is something that would make handling the button interactions much easier, since then each developer who adds an interaction wouldn't be responsible for their own manual parsing and serializing of possibly complex data.
This PR adds the Interaction Framework which was mentioned in #8
Example