Skip to content

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

Closed
wants to merge 16 commits into from

Conversation

Wessam100
Copy link

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

Copy link

sonarqubecloud bot commented Dec 7, 2024

Copy link
Owner

@iluwatar iluwatar left a 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

Comment on lines +13 to +17
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Copy link
Owner

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!");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a proper logger

Comment on lines +38 to +40
public TrafficLightState getCurrentState() {
return currentState;
}
Copy link
Owner

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

Copy link

github-actions bot commented Mar 7, 2025

This PR is stale because it has been open 60 days with no activity.

@github-actions github-actions bot added the Stale label Mar 7, 2025
@iluwatar
Copy link
Owner

iluwatar commented Mar 8, 2025

Closed due to inactivity. Thank you for the contribution.

@iluwatar iluwatar closed this Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants