j-easy / easy-rules

The simple, stupid rules engine for Java
https://github.com/j-easy/easy-rules/wiki
MIT License
4.87k stars 1.05k forks source link

Add constructor for 1 action #327

Closed sarahBuisson closed 3 years ago

sarahBuisson commented 3 years ago

This constructor will make it easier for initialise DefaultRules with lambda

fmbenhassine commented 3 years ago

DefaultRule is package private and not part of the public APIs. How will this make things easier? It is not even possible to make things (ie to create the class outside the package). And even for internal use within Easy Rules code, how is this different from:

new DefaultRule("name", "description", 1, facts -> false, Collections.singletonList(facts -> { }));

where lambdas can be used to define the condition and the single action?

fmbenhassine commented 3 years ago

I don't think this is necessary, especially that DefaultRule is package private. Thank you for your PR anyway!