-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Implemented FSM design pattern issue #203 #3116
base: master
Are you sure you want to change the base?
Conversation
…gle Responsibility Principle.
Quality Gate passedIssues Measures |
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
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