-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable library user to extend Engines to have customizable oper…
…ators (#27) This change enables each engine to have its operator without enforcing others to have the same capabilities. All built-in operations are still supported, and it doesn't restrict having others built-in operators in the future. By having this change, any library users can now start customizing the existing operators and even creating new operators without enforcing to have them in the library code base.
- Loading branch information
Showing
40 changed files
with
811 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
core/src/main/kotlin/com/rapatao/projects/ruleset/engine/context/EvalContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package com.rapatao.projects.ruleset.engine.context | ||
|
||
import com.rapatao.projects.ruleset.engine.types.Expression | ||
import com.rapatao.projects.ruleset.engine.types.operators.Operator | ||
|
||
/** | ||
* Represents an evaluation context for processing expressions. | ||
*/ | ||
fun interface EvalContext { | ||
|
||
/** | ||
* Processes an expression. | ||
* Process the expression using the given operator | ||
* | ||
* @param expression the expression to process | ||
* @return true if the expression is successfully processed, false otherwise | ||
* @throws Exception if the expression processing fails and onFailure is set to THROW | ||
*/ | ||
fun process(expression: Expression): Boolean | ||
fun process(left: Any?, operator: Operator, right: Any?): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
core/src/main/kotlin/com/rapatao/projects/ruleset/engine/types/Operator.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.