-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Implemented FSM design pattern issue #203 #3116
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
Conversation
…gle Responsibility Principle.
|
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.
In addition please ensure that
- The module contains a main entry point for executing the example (such as App.java)
- The module contains a README.md with pattern description
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> |
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 comes from parent pom.xml and can be left out
*/ | ||
@Override | ||
public void handleEvent(TrafficLightContext context) { | ||
System.out.println("Green Light: Go!"); |
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.
Use a proper logger
public TrafficLightState getCurrentState() { | ||
return currentState; | ||
} |
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.
Lombok can be used to get rid of boilerplate such as getters and setters
This PR is stale because it has been open 60 days with no activity. |
Closed due to inactivity. Thank you for the contribution. |
What problem does this PR solve?
The PR addresses issue #203 by implementing a Finite State Machine (FSM) to streamline state management in systems where behavior depends on distinct states and transitions