Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- Account(long) - Constructor for class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Account
-
Creates the account.
- action(String) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets the action, run when the rule fires; it changes the output object, which a language may bind to a name, such as
outputin MVEL. - action(Map<String, ? extends Object>, Object) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates the context an action runs against.
- action(Map<String, ? extends Object>, Object, Instant) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates the context an action runs against, for a run with a deadline.
- action(Map<String, ? extends Object>, Object, Instant, Instant, Set<String>) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates the context an action runs against, for a run that started at
startedAtby its engine's clock and was giventags: so a language's test can check what its actions make of the run'sEvaluationContext.startedAt()andEvaluationContext.tags(), as a run withRulesEngineBuilder.clock(...)andRunOptions.withTags(...)gives them. - ACTION - Enum constant in enum class io.github.brantunger.unruly.api.exception.ExpressionKind
-
The rule's action, which runs when the rule fires.
- ActionContext - Interface in io.github.brantunger.unruly.api.language
-
What an action runs against: the run's facts and the output object.
- actionInRun(EvaluationContext, Object) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates the context an action runs against, in the same run as another context: so a language's test can check that its actions find what its conditions kept with
EvaluationContext.runScoped(java.lang.Object, java.util.function.Supplier<? extends T>). - ActionResult - Class in io.github.brantunger.unruly.api.language
-
What an action did: changed the output object itself (
ActionResult.done()), or produced properties for the engine to set on it (ActionResult.set(Map)). - actionSyntaxError() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action with a syntax error, one this language's own compiler rejects.
- actionVariablesLastTheRun() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Whether a variable an action declares lasts until the end of the run, so that a later rule's action in the same run reads it, as in a language that keeps each run's variables with
EvaluationContext.runScoped(java.lang.Object, java.util.function.Supplier<? extends T>). - afterEvaluate(Rule, Map<String, Object>, boolean) - Method in class io.github.brantunger.unruly.api.LoggingRuleListener
- afterEvaluate(Rule, Map<String, Object>, boolean) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called after a rule's condition is evaluated.
- afterExecute(Rule, Object) - Method in class io.github.brantunger.unruly.api.LoggingRuleListener
- afterExecute(Rule, Object) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called after a rule's action is executed.
- afterRun(RunContext, RunResult<?>) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called when a run has finished, after the last
after*callback. - allFactsDeclared() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns whether a run may supply only the facts in
CompileContext.declaredFacts(), which the engine was told withRulesEngineBuilder.requireDeclaredFacts(). - allMatches(Supplier<O>) - Static method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Starts building an engine that fires the action of every rule whose condition is true, in priority order, all changing the same output object: DMN's rule order.
- alwaysTrue() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that is always true.
- Applicant(int) - Constructor for record class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Applicant
-
Creates an instance of a
Applicantrecord class. - ApplicantBean(int) - Constructor for class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.ApplicantBean
-
Creates the applicant.
- asMap() - Method in class io.github.brantunger.unruly.api.FactMap
- asMap() - Method in interface io.github.brantunger.unruly.api.FactStore
-
Returns a read-only view of the facts, keyed by name.
- assignment(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that assigns a value to a fact, which the language must reject when it loads or runs the rule, rather than evaluate to a boolean.
B
- beansAndMaps() - Static method in interface io.github.brantunger.unruly.api.OutputWriter
-
Returns the default writer.
- beforeEvaluate(Rule, Map<String, Object>) - Method in class io.github.brantunger.unruly.api.LoggingRuleListener
- beforeEvaluate(Rule, Map<String, Object>) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called before a rule's condition is evaluated.
- beforeExecute(Rule, Object) - Method in class io.github.brantunger.unruly.api.LoggingRuleListener
- beforeExecute(Rule, Object) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called before a rule's action is executed.
- beforeRun(RunContext) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called when a run starts, before any condition is evaluated.
- bothConditions(String, String) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that is true when both conditions are, and evaluates
conditionbeforeother, ascondition && otherdoes in MVEL. - build() - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Creates a rule from the fields set so far.
- build() - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Builds an engine with this builder's settings.
- builder() - Static method in class io.github.brantunger.unruly.api.Rule
-
Returns a builder for a new rule.
C
- CancelRegistration - Interface in io.github.brantunger.unruly.api.language
-
An action a language registered with
EvaluationContext.onCancel(Runnable), to be run when its run passes its deadline. - causeChain(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Lists an exception and its causes, from the top: the exception, its cause, its cause's cause and so on, each read as
Throwables.messageOf(java.lang.Throwable)reads a message, so agetCause()that throws ends the chain there. - changeSharedState(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that changes state the language keeps outside a run's variables and shares between runs, such as a property of a built-in object, as
Math.discount = 50is in JavaScript, or a global, setting whatnamerefers to tovalue. - checkFactName(String) - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Rejects the name of a fact that rules written in this language couldn't refer to, such as a keyword of the language.
- checksum() - Method in class io.github.brantunger.unruly.api.RuleSetInfo
-
Returns a checksum that identifies the loaded rules, so a decision can be tied to a version of them.
- classImports() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns the classes imported one by one.
- classLoader() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns the class loader to look up classes in
CompileContext.packageImports()with: the context class loader of the thread that calledload(), or the engine's own class loader if that thread has none. - clear() - Method in class io.github.brantunger.unruly.api.FactMap
- clock(Clock) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Sets the clock a run reads, once when it starts, to decide which rules are within their validity window (
Rule.getValidFrom(),Rule.getValidTo()). - close() - Method in interface io.github.brantunger.unruly.api.language.CancelRegistration
-
Stops the action from running, if it hasn't started yet.
- close() - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Releases what the compiler holds.
- close() - Method in interface io.github.brantunger.unruly.api.language.Session
-
Releases what the session holds.
- close() - Method in interface io.github.brantunger.unruly.api.RulesEngine
-
Closes the engine, and releases what its expression languages hold for the rules, such as interpreter contexts.
- column() - Method in record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Returns the value of the
columnrecord component. - comparesWholeNumbersByValue() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Whether this language compares whole numbers by value, so that a rule written for
1fires for aLong, aShortand aBigDecimalfact that holds one, and doesn't fire for a2Lfact. - compile() - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates a compile context without imports.
- compile(ExpressionLanguage, Set<String>, Set<Class<?>>, ClassLoader, Class<?>, Map<String, String>, Map<String, Class<?>>, boolean, List<String>) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates a compile context for one language, which rejects exactly the declarations an engine with that language rejects when it's built: a fact may not be declared with a name the language reserves, as its
ExpressionLanguage.reservedFactNames()returns them, asked once, so a language that reserves no name may declareoutput. - compile(Set<String>, Set<Class<?>>, ClassLoader) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates a compile context.
- compile(Set<String>, Set<Class<?>>, ClassLoader, Class<?>, Map<String, String>) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates a compile context with an output type and the language's options.
- compile(Set<String>, Set<Class<?>>, ClassLoader, Class<?>, Map<String, String>, Map<String, Class<?>>, boolean) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates a compile context for an engine that was told which facts its rules use, so a language's tests can check what it makes of the declarations.
- compile(Set<String>, Set<Class<?>>, ClassLoader, Class<?>, Map<String, String>, Map<String, Class<?>>, boolean, List<String>) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates a compile context with the language's own imports, as the engine's builder was given them with
RulesEngineBuilder.languageImports(...), so a language's tests can check what it makes of them. - compileAction(Expression) - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Compiles an action.
- compileCondition(Expression) - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Compiles a condition.
- compileContext() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns the context
evaluateAgreesWithDetailcompiles its condition with, since that check compiles it with the language's compiler, outside an engine, and the context of the compileroutputUnconvertibleValueFailsTheRuleasks to convert a value when the language's actions change the output in place. - CompileContext - Interface in io.github.brantunger.unruly.api.language
-
What every compilation of a rule list is given: the imports the engine was built with, from
RulesEngineBuilder.imports(String...), the class loader to look classes up with, the type of the output object, this language's options and its own imports, and a way to report warnings. - CompiledAction - Interface in io.github.brantunger.unruly.api.language
-
A compiled action, shared by every run of its rule list.
- CompiledCondition - Interface in io.github.brantunger.unruly.api.language
-
A compiled condition, shared by every run of its rule list.
- condition(String) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets the condition, which must evaluate to a boolean and can't assign or declare anything.
- CONDITION - Enum constant in enum class io.github.brantunger.unruly.api.exception.ExpressionKind
-
The rule's condition, which decides whether the rule fires.
- conditionDeclaration(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that declares a variable and is then true, which the language must reject when it loads or runs the rule.
- ConditionResult - Class in io.github.brantunger.unruly.api.language
-
What evaluating a condition returned, and, from a language that can explain it, why: the value, which must be a
Boolean, and a detail. - configure(RulesEngineBuilder<Map<String, Object>>) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Configures each engine the checks build, for a language that needs what the builder carries to compile its expressions: declared facts, imports or options of its own.
- containsKey(Object) - Method in class io.github.brantunger.unruly.api.FactMap
- containsValue(Object) - Method in class io.github.brantunger.unruly.api.FactMap
- convert(Object, Class<?>) - Method in interface io.github.brantunger.unruly.api.OutputConverter
-
Converts a value to one the target type accepts, as the language understands the value, or returns it unchanged where the language has no opinion.
- convertOutput(Object, Class<?>) - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Converts a value an action returned with
ActionResult.set(java.util.Map)to the type of a setter of the output object, as this language understands its own values, such as aDouble3.0, which a language whose numbers are all doubles computes for1 + 2, to theInteger3 for a setter taking anint. - convertsOutputNumbers() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Whether this language converts the numbers its actions return for the output's setters, in
convertOutput, so that a wholeDoublereaches a setter taking anintor along, and a fraction, an infinity, NaN or a whole number the setter's type doesn't hold exactly fails the rule rather than being rounded or narrowed. - copiesAtLoad(int) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Makes
countcompiled copies of the rules each timeRulesEngine.load(List)runs, so the first runs borrow copies that are ready instead of making them. - copyThroughVariable(String, String) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that declares a variable holding a fact's value, and then puts the variable's value into the output map under a key.
- creditScore() - Method in record class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Applicant
-
Returns the value of the
creditScorerecord component. - Customer(String) - Constructor for class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Customer
-
Creates the customer.
D
- deadline() - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns when the run must stop, from the timeout its engine or its
runcall was given: when the run started, on the system clock, plus its timeout. - declaredFacts() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns the facts the engine was declared with, through
RulesEngineBuilder.fact(String, Class), by fact name. - declareVariable(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that declares a variable.
- declareVariableThenFail(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that declares a variable and then fails the run, as
y = 2; Integer.parseInt('not a number')does in MVEL. - defaultLanguage(String) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Names the language of the rules whose
languageisnull. - defaults() - Static method in class io.github.brantunger.unruly.api.RunOptions
-
Returns the options that change nothing: the run uses what the engine was built with.
- description(String) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets the rule's description: free text for your own use, which the engine ignores but listeners receive.
- detail() - Method in class io.github.brantunger.unruly.api.language.ConditionResult
-
Returns why the condition evaluated to its value, in the language's own terms.
- detail() - Method in class io.github.brantunger.unruly.api.RuleEvaluation
-
Returns why the rule's condition evaluated as it did, in its language's own terms, such as the operands a comparison read: the
detailthe language returned fromevaluateWithDetail. - done() - Static method in class io.github.brantunger.unruly.api.language.ActionResult
-
Returns the result of an action that changed the output object itself, or changed nothing.
E
- enabled(Boolean) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets whether runs use the rule.
- endlessAction() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that runs until its run passes its deadline, and stops then, such as
while (true) {}in a language that registers an action withEvaluationContext.onCancel(Runnable)which stops its runtime, or that pollsEvaluationContext.isCancelled(). - endRun(EvaluationContext) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Ends the run of a context, as the engine ends a run: closes the actions the run registered with
EvaluationContext.onCancel(Runnable)that haven't started, then the values the run keeps withEvaluationContext.runScopedClosing(java.lang.Object, java.util.function.Supplier<? extends T>), in the reverse of the order they were made, so a language's test can check that it releases what it opened for the run. - entrySet() - Method in class io.github.brantunger.unruly.api.FactMap
-
Returns a view of the entries backed by this map.
- equals(Object) - Method in record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in class io.github.brantunger.unruly.api.Fact
- equals(Object) - Method in class io.github.brantunger.unruly.api.FactMap
-
Compares by entries, as the
Mapcontract requires: equal to anyMap, of any implementation, holding equal facts under the same names. - equals(Object) - Method in class io.github.brantunger.unruly.api.language.ActionResult
- equals(Object) - Method in class io.github.brantunger.unruly.api.language.ConditionResult
-
Compares the value and the detail, each with its own
equals, so a detail that is an array is compared by identity, asActionResultcompares the values of its properties. - equals(Object) - Method in record class io.github.brantunger.unruly.api.language.Expression
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in class io.github.brantunger.unruly.api.Rule
-
Compares every field.
- equals(Object) - Method in class io.github.brantunger.unruly.api.RuleEvaluation
- equals(Object) - Method in class io.github.brantunger.unruly.api.RuleSetInfo
-
Compares every field.
- equals(Object) - Method in class io.github.brantunger.unruly.api.RunOptions
-
Compares every setting.
- equals(Object) - Method in class io.github.brantunger.unruly.api.RunResult
-
Compares every field except
RunResult.startedAt(), which the class description explains. - equals(Object) - Method in record class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Applicant
-
Indicates whether some other object is "equal to" this one.
- ERROR - Enum constant in enum class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue.Severity
-
The expression can't be compiled.
- escape(String) - Static method in class io.github.brantunger.unruly.api.language.MessageText
-
Escapes text for a message, without shortening it.
- escapeWithin(String, int) - Static method in class io.github.brantunger.unruly.api.language.MessageText
-
Escapes text for a message as
MessageText.escape(java.lang.String)does, shortened first if its escaped form is longer thanroomcharacters: to as many of its first characters as fit inroomwith... (N more characters)after them, asMessageText.truncate(java.lang.String)writes it. - escapeWithin(String, int, int) - Static method in class io.github.brantunger.unruly.api.language.MessageText
-
Escapes text within a room as
MessageText.escapeWithin(String, int)does, showing at most its firstmostcharacters (UTF-16 units). - evaluate(EvaluationContext, Session) - Method in interface io.github.brantunger.unruly.api.language.CompiledCondition
-
Evaluates the condition.
- evaluateWithDetail(EvaluationContext, Session) - Method in interface io.github.brantunger.unruly.api.language.CompiledCondition
-
Evaluates the condition and explains its result.
- evaluation(Map<String, ? extends Object>) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates the context a condition is evaluated against.
- evaluation(Map<String, ? extends Object>, Instant) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates the context a condition is evaluated against, for a run with a deadline.
- evaluation(Map<String, ? extends Object>, Instant, Instant, Set<String>) - Static method in class io.github.brantunger.unruly.test.LanguageTestContexts
-
Creates the context a condition is evaluated against, for a run that started at
startedAtby its engine's clock and was giventags: so a language's test can check what its conditions make of the run'sEvaluationContext.startedAt()andEvaluationContext.tags(), as a run withRulesEngineBuilder.clock(...)andRunOptions.withTags(...)gives them. - EvaluationContext - Interface in io.github.brantunger.unruly.api.language
-
What a condition is evaluated against.
- evaluations() - Method in class io.github.brantunger.unruly.api.RunResult
-
Returns what each rule's condition evaluated to: one evaluation for every loaded rule, in evaluation order, the same
Ruleinstances asRuleSetInfo.rules(). - execute(ActionContext, Session) - Method in interface io.github.brantunger.unruly.api.language.CompiledAction
-
Executes the action.
- Expression - Record Class in io.github.brantunger.unruly.api.language
-
One condition or action of a rule, as an
ExpressionCompilercompiles it: which rule it belongs to, whether it's the condition or the action, and its text. - Expression(String, ExpressionKind, String) - Constructor for record class io.github.brantunger.unruly.api.language.Expression
-
Creates an expression.
- ExpressionCompiler - Interface in io.github.brantunger.unruly.api.language
-
Compiles the conditions and actions of one rule list, checks the names of the facts they run against, and creates the sessions they run with.
- ExpressionKind - Enum Class in io.github.brantunger.unruly.api.exception
-
Which part of a rule an expression is.
- ExpressionLanguage - Interface in io.github.brantunger.unruly.api.language
-
A language that rule conditions and actions are written in, such as MVEL.
- ExpressionLanguageContractTest - Class in io.github.brantunger.unruly.test
-
What the engine promises for rules in any expression language.
- ExpressionLanguageContractTest() - Constructor for class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Creates the test.
- ExpressionLanguageContractTest.Account - Class in io.github.brantunger.unruly.test
-
An account as a JavaBean with a setter taking a
long, the outputoutputNumbersConvertedwrites a wholeDoublenointholds to. - ExpressionLanguageContractTest.Applicant - Record Class in io.github.brantunger.unruly.test
-
An applicant, so a language's tests can run a rule against a record fact.
- ExpressionLanguageContractTest.ApplicantBean - Class in io.github.brantunger.unruly.test
-
An applicant as a JavaBean, so a language's tests can run a rule against a fact whose property is a getter.
- ExpressionLanguageContractTest.Customer - Class in io.github.brantunger.unruly.test
- ExpressionLanguageContractTest.Nesting - Class in io.github.brantunger.unruly.test
-
The fact the nested-run checks run their rules against: its
valueproperty starts a run nested inside the run that reads it, on the same thread, as a getter a condition or an action reads, or a function it calls, does when it runs rules. - ExpressionLanguageContractTest.WritableApplicant - Class in io.github.brantunger.unruly.test
-
An applicant as a JavaBean with a setter, so a language's tests can run a rule against a fact whose property a condition could write.
F
- fact(String, Class<?>) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Declares a fact's name and type, so the engine checks a run's value against the type and a language can check its expressions against it.
- Fact<T> - Class in io.github.brantunger.unruly.api
-
The built-in, immutable
FactReference. - Fact(FactReference<? extends T>) - Constructor for class io.github.brantunger.unruly.api.Fact
-
Instantiate a Fact from another Fact object.
- Fact(String, T) - Constructor for class io.github.brantunger.unruly.api.Fact
-
Instantiate a Fact from the name and value.
- factEquals(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that is true when a whole-number fact equals a value.
- FactMap<T> - Class in io.github.brantunger.unruly.api
- FactMap() - Constructor for class io.github.brantunger.unruly.api.FactMap
-
Construct a new empty FactMap.
- FactMap(FactReference<T>...) - Constructor for class io.github.brantunger.unruly.api.FactMap
-
Construct a new FactMap from an array of existing FactReference objects
- FactMap(Map<String, ? extends FactReference<T>>) - Constructor for class io.github.brantunger.unruly.api.FactMap
-
Construct a new FactMap from a map of facts.
- factNamesRead() - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Returns the names of the facts the conditions and actions this compiler compiled can read, or
nullif it can't tell. - FactProperties - Class in io.github.brantunger.unruly.api.language
-
Reads a property of a fact the way rules expect: a record component, a JavaBean getter or a
Mapkey. - factProperty(String, String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that compares one property of a fact with a value, as
applicant.creditScore == 750does in MVEL. - FactReference<T> - Interface in io.github.brantunger.unruly.api
-
A named value that rules run against.
- facts() - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns the values of the run's facts by name.
- facts() - Method in interface io.github.brantunger.unruly.api.RunContext
-
Returns the fact values the run was given, the same read-only view the rule callbacks receive.
- facts(Map<String, ? extends Class<?>>) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Declares several facts at once, as
RulesEngineBuilder.fact(String, Class)does one. - FactStore<T> - Interface in io.github.brantunger.unruly.api
-
A store of facts, each kept under its name.
- factValue(String) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition whose result is a fact's value, whatever its type.
- failures() - Method in exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Returns every failure of the load, in the order they were found: each broken rule's, in priority order; a language that couldn't create its compiler, in place of the first rule that needed it; and each declared fact name the languages reject, last.
- FALSE - Static variable in class io.github.brantunger.unruly.api.language.ConditionResult
-
The result of a condition that was
false, without a detail. - fatalError(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Finds the fatal error (see
Throwables.isFatal(java.lang.Throwable)) in what was caught, as the engine finds the one it rethrows: the throwable itself, or one of its causes, or failing that one suppressed on any of them, or among the causes and suppressed exceptions of those, at any depth, as atry-with-resources whoseclose()hits anOutOfMemoryErrorwhile its body throws leaves it. - firedRules() - Method in class io.github.brantunger.unruly.api.RunResult
-
Returns the rules whose actions ran, in firing order.
- firstMatch(Supplier<O>) - Static method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Starts building an engine that fires the action of the highest-priority rule whose condition is true: the first match, in DMN's terms.
G
- get(Object) - Method in class io.github.brantunger.unruly.api.FactMap
- getAction() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns the action, run when the rule fires.
- getBalance() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Account
-
Returns the account's balance.
- getCondition() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns the condition, which must evaluate to a boolean and can't assign or declare anything.
- getCreditScore() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.ApplicantBean
-
Returns the applicant's credit score.
- getCreditScore() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.WritableApplicant
-
Returns the applicant's credit score.
- getDescription() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns the rule's description: free text for your own use, which the engine ignores but listeners receive.
- getExpressionKind() - Method in exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Returns whether the rule's condition or its action failed.
- getExpressionKind() - Method in exception class io.github.brantunger.unruly.api.exception.RuleExecutionException
-
Returns whether the rule's condition or its action failed.
- getLanguage() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns the name of the expression language the condition and action are written in.
- getName() - Method in class io.github.brantunger.unruly.api.Fact
- getName() - Method in interface io.github.brantunger.unruly.api.FactReference
-
Gets the name of the fact.
- getName() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Customer
-
Returns the customer's name.
- getPriority() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns the rule's priority.
- getRuleName() - Method in exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Returns the name of the rule that failed, as
Rule.getRuleName()returns it. - getRuleName() - Method in exception class io.github.brantunger.unruly.api.exception.RuleExecutionException
-
Returns the name of the rule that failed, as
Rule.getRuleName()returns it. - getRuleName() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns the rule's name, used in error messages, exceptions and listener callbacks.
- getTags() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns the names that group the rule.
- getValidFrom() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns when runs start to use the rule.
- getValidTo() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns when runs stop using the rule.
- getValue() - Method in class io.github.brantunger.unruly.api.Fact
- getValue() - Method in interface io.github.brantunger.unruly.api.FactReference
-
Gets the value of the fact.
- getValue() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Nesting
-
Starts the nested run, and returns 7 whether the run returned or threw an exception, unless it's the one
nestedRunFailureRethrownAsIsgives the outer run, which throws on, unchanged, the exception the run threw; anErrorit threw is thrown on. - getValue(String) - Method in class io.github.brantunger.unruly.api.FactMap
-
Gets the value of the fact stored under a name.
- getValue(String) - Method in interface io.github.brantunger.unruly.api.FactStore
-
Gets the value of the fact stored under a name.
H
- has(Object, String) - Static method in class io.github.brantunger.unruly.api.language.FactProperties
-
Says whether a fact has a property, without reading it: whether
FactProperties.read(java.lang.Object, java.lang.String)would find the property rather than throwIllegalArgumentException. - hashCode() - Method in record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Returns a hash code value for this object.
- hashCode() - Method in class io.github.brantunger.unruly.api.Fact
-
Based on the name and value.
- hashCode() - Method in class io.github.brantunger.unruly.api.FactMap
- hashCode() - Method in class io.github.brantunger.unruly.api.language.ActionResult
- hashCode() - Method in class io.github.brantunger.unruly.api.language.ConditionResult
- hashCode() - Method in record class io.github.brantunger.unruly.api.language.Expression
-
Returns a hash code value for this object.
- hashCode() - Method in class io.github.brantunger.unruly.api.Rule
-
Combines the hash codes of every field, consistently with
Rule.equals(Object). - hashCode() - Method in class io.github.brantunger.unruly.api.RuleEvaluation
- hashCode() - Method in class io.github.brantunger.unruly.api.RuleSetInfo
-
Combines the hash codes of the checksum and the load time, consistently with
RuleSetInfo.equals(Object). - hashCode() - Method in class io.github.brantunger.unruly.api.RunOptions
-
Combines the hash codes of every setting, consistently with
RunOptions.equals(Object). - hashCode() - Method in class io.github.brantunger.unruly.api.RunResult
-
Combines the hash codes of the output, the checksum and the tags with the number of fired rules, consistently with
RunResult.equals(Object). - hashCode() - Method in record class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Applicant
-
Returns a hash code value for this object.
I
- ImportLimits - Class in io.github.brantunger.unruly.api.language
-
How large an import may be, as the engine bounds the imports it is built with, for a language that reads an
importin an expression's own text: it bounds that import the same way, and rejects it with the same reason, rather than keeping a copy of the limits that could drift. - imports(String...) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Adds imports that every language compiles rules with, so rule expressions can refer to classes by their simple names.
- imports(Collection<String>) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Adds imports, as
RulesEngineBuilder.imports(String...)does. - importSizeProblem(String) - Static method in class io.github.brantunger.unruly.api.language.ImportLimits
-
Says why an import is too large to look up, if it is, as the engine says it: too long, or else with too many parts, counting its dots as separators whatever is between them, so an empty import has one part.
- InvalidExpressionException - Exception Class in io.github.brantunger.unruly.api.exception
-
Thrown by an
ExpressionCompilerto reject an expression: one that breaks a rule the engine enforces, such as a condition that assigns to a fact, or one with an error the language can point to, such as a syntax error. - InvalidExpressionException(String) - Constructor for exception class io.github.brantunger.unruly.api.exception.InvalidExpressionException
-
Constructs a new exception with the specified detail message and no issues.
- InvalidExpressionException(String, List<InvalidExpressionException.Issue>) - Constructor for exception class io.github.brantunger.unruly.api.exception.InvalidExpressionException
-
Constructs a new exception with the specified detail message and issues.
- InvalidExpressionException(String, List<InvalidExpressionException.Issue>, Throwable) - Constructor for exception class io.github.brantunger.unruly.api.exception.InvalidExpressionException
-
Constructs a new exception with the specified detail message, issues and cause.
- InvalidExpressionException.Issue - Record Class in io.github.brantunger.unruly.api.exception
-
One problem a language found in an expression.
- InvalidExpressionException.Issue.Severity - Enum Class in io.github.brantunger.unruly.api.exception
-
Whether an issue stops an expression compiling.
- io.github.brantunger.unruly - module io.github.brantunger.unruly
-
The Unruly rules engine with the MVEL expression language.
- io.github.brantunger.unruly.api - package io.github.brantunger.unruly.api
-
The engine's public API: build an engine, give it rules, run it against facts, and observe its runs.
- io.github.brantunger.unruly.api.exception - package io.github.brantunger.unruly.api.exception
-
The exceptions the engine throws, all unchecked and all extending
UnrulyException. - io.github.brantunger.unruly.api.language - package io.github.brantunger.unruly.api.language
-
The interfaces an expression language implements, so rule conditions and actions can be compiled and run, and the ones the engine passes to it.
- io.github.brantunger.unruly.core - module io.github.brantunger.unruly.core
-
The Unruly rules engine without an expression language.
- io.github.brantunger.unruly.mvel - package io.github.brantunger.unruly.mvel
-
MVEL 2 as an expression language for the engine:
MvelExpressionLanguage, namedmvel. - io.github.brantunger.unruly.test - module io.github.brantunger.unruly.test
-
Tools for testing an expression language: a contract test that any language's tests extend, and the contexts the engine passes to a language, for unit tests of its compiler and compiled expressions.
- io.github.brantunger.unruly.test - package io.github.brantunger.unruly.test
-
Tools for testing an expression language.
- isCancelled() - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns whether the run must stop, because its thread has been interrupted or it has passed its deadline.
- isEmpty() - Method in class io.github.brantunger.unruly.api.FactMap
- isEnabled() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns whether runs use the rule.
- isFatal(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Tells whether a throwable is an
Errorthe engine must not absorb, because the JVM itself is failing and no message about a rule would help: aVirtualMachineErrorother thanStackOverflowError, such asOutOfMemoryError,InternalErrororUnknownError, but not anInternalErrorthat wraps an overflow (seeThrowables.isOverflow(java.lang.Throwable)). - isInterrupt(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Tells whether what was caught was caused by an interrupt, or carries one: an
InterruptedExceptionis the throwable itself, one of its causes, or suppressed on any of them, or among the causes and suppressed exceptions of those, read asThrowables.fatalError(java.lang.Throwable)reads them, in the same order, with the same limits, and skipping what the engine itself added. - isMissingRegistration(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Tells whether an error is the one a native image built with strict reachability metadata throws for a class or method lookup it has no metadata for, existing or not, where any other build, and the JVM, throw
ClassNotFoundExceptionorNoSuchMethodException, or list what is there: GraalVM'sorg.graalvm.nativeimage.MissingReflectionRegistrationError, anErrorin GraalVM for JDK 21 and aLinkageErrorin GraalVM for JDK 25. - isOverflow(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Tells whether a throwable is a
StackOverflowError, or what was thrown in place of one: walking its cause chain from the top, asThrowables.causeChain(java.lang.Throwable)walks it, aStackOverflowErrorcomes before anyLinkageError. - Issue(InvalidExpressionException.Issue.Severity, int, int, String) - Constructor for record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Creates an issue.
- issues() - Method in exception class io.github.brantunger.unruly.api.exception.InvalidExpressionException
-
Returns where and what the language found wrong with the expression.
- issues() - Method in exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Returns where and what the expression language found wrong, when it said.
- isWrongName(Throwable, String) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Tells whether an error a class lookup threw only means that a class file was found for the name looked up in a different case, as a class directory on a case-insensitive file system finds one, so there is no class by that name: the JVM's "wrong name"
NoClassDefFoundError.
K
- keySet() - Method in class io.github.brantunger.unruly.api.FactMap
- kind() - Method in record class io.github.brantunger.unruly.api.language.Expression
-
Returns the value of the
kindrecord component.
L
- language() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns the language under test.
- language(ExpressionLanguage) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Adds an expression language that rules can be written in, chosen by each rule's
language. - language(String) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets the name of the expression language the condition and action are written in.
- LANGUAGE_NAME - Static variable in class io.github.brantunger.unruly.mvel.MvelExpressionLanguage
-
The language's name.
- languageImports() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns the imports given for this language only, with
RulesEngineBuilder.languageImports(String, String...), as written and in order, duplicates included. - languageImports(String, String...) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Adds imports for one expression language only, which it reads from
CompileContext.languageImports()when rules are loaded: as written, in order, duplicates included. - languageImports(String, Collection<String>) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Adds imports for one expression language only, as
RulesEngineBuilder.languageImports(String, String...)does. - LanguageTestContexts - Class in io.github.brantunger.unruly.test
-
Creates the contexts the engine passes to an expression language, for unit tests of a language's compiler and compiled expressions.
- leftOut(int) - Static method in class io.github.brantunger.unruly.api.language.MessageText
-
Writes the note that follows shortened text, as
MessageText.truncate(java.lang.String),MessageText.quote(java.lang.String)and the engine's own messages write it:... (N more characters), N being how many characters of the text were left out. - line() - Method in record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Returns the value of the
linerecord component. - listener(RuleListener) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Adds a listener that is told about every condition evaluated and every action run.
- listeners(Collection<? extends RuleListener>) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Adds listeners, in the order given, as
RulesEngineBuilder.listener(RuleListener)does. - load(List<Rule>) - Method in interface io.github.brantunger.unruly.api.RulesEngine
-
Compiles a rule list and swaps it in for the rules loaded before, if any.
- loadedAt() - Method in class io.github.brantunger.unruly.api.RuleSetInfo
-
Returns when the rules finished compiling, by the system clock.
- LoggingRuleListener - Class in io.github.brantunger.unruly.api
-
A
RuleListenerthat logs each rule's callbacks through SLF4J at DEBUG:beforeEvaluate,afterEvaluate,beforeExecute,afterExecuteandonError. - LoggingRuleListener() - Constructor for class io.github.brantunger.unruly.api.LoggingRuleListener
-
Creates a listener that logs through the SLF4J logger named after this class.
M
- MATCHED - Enum constant in enum class io.github.brantunger.unruly.api.RuleEvaluation.Outcome
-
The condition was true.
- matchPolicy() - Method in interface io.github.brantunger.unruly.api.RunContext
-
Returns which rules the engine fires:
"firstMatch"for the action of the highest-priority matching rule,"allMatches"for every match in priority order, or"uniqueMatch"for the one match, failing the run when there are more. - MAX_IMPORT_LENGTH - Static variable in class io.github.brantunger.unruly.api.language.ImportLimits
-
The most characters (UTF-16 units) an import may have: 1,000, fixed for 2.x.
- MAX_IMPORT_PARTS - Static variable in class io.github.brantunger.unruly.api.language.ImportLimits
-
The most dot-separated parts an import may have: 64, fixed for 2.x.
- MAX_NAME_LENGTH - Static variable in class io.github.brantunger.unruly.api.language.MessageText
-
The most characters (UTF-16 units) of a name
MessageText.quote(java.lang.String)shows: 200, fixed for 2.x. - MAX_TEXT_LENGTH - Static variable in class io.github.brantunger.unruly.api.language.MessageText
-
The most characters (UTF-16 units) of other text
MessageText.truncate(java.lang.String)keeps, and the length above which the engine shortens the messages the class description lists: 1,000, fixed for 2.x. - maxCopies(int) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Keeps at most
maxCopiescompiled copies of the rules, for runs on every kind of thread, instead of the default limit on runs from virtual threads. - message() - Method in record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Returns the value of the
messagerecord component. - messageOf(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Reads an exception's message without letting a failure to read it escape.
- MessageText - Class in io.github.brantunger.unruly.api.language
-
Shortens and escapes text a language didn't write, such as a fact name, an option value, an import or its library's own error text, for a message, as the engine does in its own messages.
- missingFactProperty(String, String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that reads a property the fact doesn't have, which the language must reject when it loads or runs the rule, rather than evaluate to
false. - Modules - Search tag in Overview
- Section
- MvelExpressionLanguage - Class in io.github.brantunger.unruly.mvel
-
MVEL 2 as an expression language for the engine, named "mvel".
- MvelExpressionLanguage() - Constructor for class io.github.brantunger.unruly.mvel.MvelExpressionLanguage
-
Creates the MVEL language.
N
- name() - Method in interface io.github.brantunger.unruly.api.language.ExpressionLanguage
-
Returns the language's name, such as
"mvel". - name() - Method in class io.github.brantunger.unruly.mvel.MvelExpressionLanguage
- newCompiler(CompileContext) - Method in interface io.github.brantunger.unruly.api.language.ExpressionLanguage
-
Creates the compiler for one rule list.
- newCompiler(CompileContext) - Method in class io.github.brantunger.unruly.mvel.MvelExpressionLanguage
-
Creates the compiler for one rule list, with the context's Java imports, class loader, declared facts and options.
- newSession() - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Creates a session for one copy of the rule list: the state this language's conditions and actions change while they run.
- none() - Static method in interface io.github.brantunger.unruly.api.language.Session
-
Returns the session of a language that keeps no state between runs.
- NOT_EVALUATED - Enum constant in enum class io.github.brantunger.unruly.api.RuleEvaluation.Outcome
-
The condition wasn't evaluated: the rule comes after the match on a first-match engine, so it's neither matched nor unmatched.
- NOT_MATCHED - Enum constant in enum class io.github.brantunger.unruly.api.RuleEvaluation.Outcome
-
The condition was false.
O
- of(O, List<Rule>, String) - Static method in class io.github.brantunger.unruly.api.RunResult
-
Creates a result without evaluations.
- of(O, List<Rule>, List<RuleEvaluation>, String) - Static method in class io.github.brantunger.unruly.api.RunResult
-
Creates a result.
- of(Rule, RuleEvaluation.Outcome) - Static method in class io.github.brantunger.unruly.api.RuleEvaluation
-
Creates an evaluation.
- of(Rule, RuleEvaluation.Outcome, Object) - Static method in class io.github.brantunger.unruly.api.RuleEvaluation
-
Creates an evaluation with the detail the rule's condition was explained with.
- of(Object) - Static method in class io.github.brantunger.unruly.api.language.ConditionResult
-
Returns the result of a condition without a detail:
ConditionResult.TRUEorConditionResult.FALSEfor aBoolean. - of(Object, Object) - Static method in class io.github.brantunger.unruly.api.language.ConditionResult
-
Returns the result of a condition with the detail that explains it.
- of(List<Rule>, String, Instant) - Static method in class io.github.brantunger.unruly.api.RuleSetInfo
-
Creates the information about a loaded rule list.
- onCancel(Runnable) - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Has
actionrun once when the run passes its deadline, unless the registration returned is closed first. - onError(Rule, RuleExecutionException) - Method in class io.github.brantunger.unruly.api.LoggingRuleListener
-
Logs a rule's failure as
Failed rule: <name> | Error: <message>, or, when the run stopped during the rule because its thread was interrupted or it passed its deadline, asStopped rule: <name> | <message>. - onError(Rule, RuleExecutionException) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called when evaluating a rule's condition or executing its action fails, in place of
RuleListener.afterEvaluate(io.github.brantunger.unruly.api.Rule, java.util.Map<java.lang.String, java.lang.Object>, boolean)orRuleListener.afterExecute(io.github.brantunger.unruly.api.Rule, java.lang.Object). - onRunError(RunContext, RuntimeException) - Method in interface io.github.brantunger.unruly.api.RuleListener
-
Called when a run fails, in place of
RuleListener.afterRun(io.github.brantunger.unruly.api.RunContext, io.github.brantunger.unruly.api.RunResult<?>). - option(String, String, String) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Sets an option for one expression language, which the language reads from
CompileContext.options()when rules are loaded. - options() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns this language's options, set with
RulesEngineBuilder.option(String, String, String). - outcome() - Method in class io.github.brantunger.unruly.api.RuleEvaluation
-
Returns what evaluating the rule's condition found, or that the run skipped the rule.
- output() - Method in interface io.github.brantunger.unruly.api.language.ActionContext
-
Returns the output object.
- output() - Method in class io.github.brantunger.unruly.api.RunResult
-
Returns the output object the run produced.
- OUTPUT_NAME - Static variable in interface io.github.brantunger.unruly.api.language.ActionContext
-
The name an action uses for the output object, in a language that binds it to a name, such as MVEL.
- OutputConverter - Interface in io.github.brantunger.unruly.api
-
Converts a value an action returned with
ActionResult.set(java.util.Map)to the type of a setter, as the rule's expression language understands its own values. - outputType() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns the type of the output object, which the engine was built with through
RulesEngineBuilder.outputType(Class). - outputType(Class<? super O>) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Tells expression languages the type of the output object, through
CompileContext.outputType(). - outputWriter(OutputWriter<? super O>) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Sets how the engine sets the properties an action returns with
ActionResult.set(Map)on the output object. - OutputWriter<O> - Interface in io.github.brantunger.unruly.api
-
Sets a property on the output object.
P
- packageImports() - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Returns the imported packages, whose classes rules can refer to by their simple names.
- parent() - Method in interface io.github.brantunger.unruly.api.RunContext
-
Returns the run this one started from, for a run an action or a listener started on the same engine and thread.
- prepare() - Method in interface io.github.brantunger.unruly.api.language.ExpressionLanguage
-
Initializes the classes with a static initializer that the language's first compile or run would otherwise be the first to use: the language's own and those of any library it runs on.
- prepare() - Method in class io.github.brantunger.unruly.mvel.MvelExpressionLanguage
-
Initializes the classes with a static initializer that loading MVEL rules, running them and a load that fails would otherwise be the first to use: this language's own, MVEL's, and those of the JDK that only they use, such as the JDK's logging, which MVEL logs with, and
BigIntegerandBigDecimal, which MVEL makes a rule's firstBigDecimalliteral, such as1.5B, with. - priority(Integer) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets the rule's priority: higher values fire first, and
nullsorts last. - properties() - Method in class io.github.brantunger.unruly.api.language.ActionResult
-
Returns the properties to set on the output object.
- propertyAssignment(String, String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that writes a property of a fact, which the language must reject when it loads or runs the rule.
- propertyNames(Object) - Static method in class io.github.brantunger.unruly.api.language.FactProperties
-
Lists the properties
FactProperties.read(java.lang.Object, java.lang.String)can read on a fact, without reading any of them, for a language that enumerates an object's properties, such as JavaScript'sObject.keysor Python'sdir. - put(FactReference<T>) - Method in class io.github.brantunger.unruly.api.FactMap
-
Stores a
FactReferenceunder its name. - put(FactReference<T>) - Method in interface io.github.brantunger.unruly.api.FactStore
-
Stores a
FactReferenceunder its name. - put(String, FactReference<T>) - Method in class io.github.brantunger.unruly.api.FactMap
-
Stores
factunderkey. - putAll(Map<? extends String, ? extends FactReference<T>>) - Method in class io.github.brantunger.unruly.api.FactMap
-
Copies every entry of
mapinto this map. - putFact(String, String) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that puts a fact's value into the output map, by changing the output or by returning the property in an
ActionResult. - putFactProperty(String, String, String) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that puts one property of a fact, read through its getter, into the output map under a key.
- putVariable(String, String) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that puts a variable's value into the output map under a key.
Q
- quote(String) - Static method in class io.github.brantunger.unruly.api.language.MessageText
-
Shortens a name for a message to at most 200 characters (
MessageText.MAX_NAME_LENGTH, UTF-16 units), thenescapesit. - quoteWithin(String, int) - Static method in class io.github.brantunger.unruly.api.language.MessageText
-
Quotes a name for a message as
MessageText.quote(java.lang.String)does, or, if that is longer thanroomcharacters, escapes it within the room asMessageText.escapeWithin(String, int)does.
R
- read(Object, String) - Static method in class io.github.brantunger.unruly.api.language.FactProperties
-
Reads a property of a fact.
- reassignOutput() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns an action that assigns a new object to the output.
- remove(Object) - Method in class io.github.brantunger.unruly.api.FactMap
- replaceAll(BiFunction<? super String, ? super FactReference<T>, ? extends FactReference<T>>) - Method in class io.github.brantunger.unruly.api.FactMap
-
Replaces every fact with the function's result.
- requireDeclaredFacts() - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Rejects a run that supplies a fact nobody declared, or leaves a declared fact out.
- reservedFactNames() - Method in interface io.github.brantunger.unruly.api.language.ExpressionLanguage
-
Returns the fact names this language reserves for itself, such as the name its actions see the output object by.
- reservedFactNames() - Method in class io.github.brantunger.unruly.mvel.MvelExpressionLanguage
-
Returns "output", the name MVEL's actions see the output object by, which would hide a fact of the same name.
- reservesForEveryRuleList() - Method in interface io.github.brantunger.unruly.api.language.ExpressionLanguage
-
Tells whether the names
ExpressionLanguage.reservedFactNames()returns are reserved for every rule list the engine loads, or only for a rule list that uses this language. - reservesForEveryRuleList() - Method in class io.github.brantunger.unruly.mvel.MvelExpressionLanguage
-
Returns
false: only MVEL's actions see the output object by "output", so the name is reserved only for a rule list with an MVEL rule, or with no rules while MVEL is the default language. - rootCause(Throwable) - Static method in class io.github.brantunger.unruly.api.language.Throwables
-
Finds the last exception in an exception's cause chain, as
Throwables.causeChain(java.lang.Throwable)reads it: the exception itself if it has no cause, or the last cause that could be read, which the engine names in a message when the description would otherwise hide it. - rule() - Method in class io.github.brantunger.unruly.api.RuleEvaluation
-
Returns the rule, the same instance that was passed to
RulesEngine.load(java.util.List). - Rule - Class in io.github.brantunger.unruly.api
-
A rule: a condition that decides whether it fires, and an action that runs when it does, with a name, a priority and the language they're written in.
- Rule.RuleBuilder - Class in io.github.brantunger.unruly.api
-
Builds a
Rule. - RuleBuilder() - Constructor for class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Creates a builder for an enabled rule with no validity window, no tags, and every other field
null. - RuleCompilationException - Exception Class in io.github.brantunger.unruly.api.exception
-
Exception thrown when a rule fails to compile, or when several do.
- RuleCompilationException(String) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Constructs a new exception with the specified detail message.
- RuleCompilationException(String, Throwable) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Constructs a new exception with the specified detail message and cause.
- RuleCompilationException(String, Throwable, String) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Constructs a new exception with the specified detail message, cause and the name of the rule that failed.
- RuleCompilationException(String, Throwable, String, ExpressionKind, List<InvalidExpressionException.Issue>) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Constructs a new exception for one rule's condition or action.
- RuleCompilationException(String, List<RuleCompilationException>) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleCompilationException
-
Constructs an exception for several failures while loading a rule list.
- RuleEvaluation - Class in io.github.brantunger.unruly.api
-
What a run found out about one rule: whether its condition was true, false, or never evaluated, or whether the run skipped the rule.
- RuleEvaluation.Outcome - Enum Class in io.github.brantunger.unruly.api
-
What evaluating a rule's condition found, or that the run skipped the rule.
- RuleExecutionException - Exception Class in io.github.brantunger.unruly.api.exception
-
Thrown by
run()when a run fails: because a rule's condition or action failed, or because something outside any rule did. - RuleExecutionException(String) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleExecutionException
-
Constructs a new exception with the specified detail message.
- RuleExecutionException(String, Throwable) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleExecutionException
-
Constructs a new exception with the specified detail message and cause.
- RuleExecutionException(String, Throwable, String) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleExecutionException
-
Constructs a new exception with the specified detail message, cause and the name of the rule that failed.
- RuleExecutionException(String, Throwable, String, ExpressionKind) - Constructor for exception class io.github.brantunger.unruly.api.exception.RuleExecutionException
-
Constructs a new exception for one rule's condition or action.
- RuleListener - Interface in io.github.brantunger.unruly.api
-
A listener interface to hook into the lifecycle of rule evaluation and execution.
- ruleName() - Method in record class io.github.brantunger.unruly.api.language.Expression
-
Returns the value of the
ruleNamerecord component. - ruleName(String) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets the rule's name, used in error messages, exceptions and listener callbacks.
- rules() - Method in interface io.github.brantunger.unruly.api.RulesEngine
-
Returns the rules the engine has loaded, their checksum and when they were loaded.
- rules() - Method in class io.github.brantunger.unruly.api.RuleSetInfo
-
Returns the rules the last successful
RulesEngine.load(List)compiled, in the order they're evaluated: by descending priority, with equal priorities in the order they were given. - RulesEngine<O> - Interface in io.github.brantunger.unruly.api
-
Runs rules against facts: it evaluates each
Rule's condition and fires the actions of the rules that match, as its match policy decides. - RulesEngineBuilder<O> - Class in io.github.brantunger.unruly.api
-
Configures and builds a
RulesEngine. - ruleSetChecksum() - Method in interface io.github.brantunger.unruly.api.RunContext
-
Returns the checksum of the rules this run uses, as
RuleSetInfo.checksum()describes it. - ruleSetChecksum() - Method in class io.github.brantunger.unruly.api.RunResult
-
Returns the checksum of the rules this run used.
- RuleSetInfo - Class in io.github.brantunger.unruly.api
-
The rules an engine has loaded, from
RulesEngine.rules(): the rules themselves, a checksum that identifies them, and when they were loaded. - run(FactStore<?>) - Method in interface io.github.brantunger.unruly.api.RulesEngine
-
Runs the loaded rules against facts.
- RunContext - Interface in io.github.brantunger.unruly.api
-
One run of an engine, given to
RuleListener's run callbacks. - runId() - Method in interface io.github.brantunger.unruly.api.RunContext
-
Returns the run's identifier, which counts up from one within an engine.
- RunOptions - Class in io.github.brantunger.unruly.api
-
Settings for one run, given to
RulesEngine.runWithResult(FactStore, RunOptions). - RunResult<O> - Class in io.github.brantunger.unruly.api
-
What one run did: the output object, the rules that fired, what each rule's condition evaluated to, the checksum of the rules it used, and the tags and start time that chose which of them it used.
- runScoped(Object, Supplier<? extends T>) - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns the value kept under
keyfor this run, making it withinitthe first time any condition or action of the run asks for it. - runScopedClosing(Object, Supplier<? extends T>) - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns the value kept under
keyfor this run, asEvaluationContext.runScoped(java.lang.Object, java.util.function.Supplier<? extends T>)does, and closes it when the run ends. - runTimeout(Duration) - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Stops a run that is still going after
timeout. - runWithResult(FactStore<?>) - Method in interface io.github.brantunger.unruly.api.RulesEngine
-
Runs the rules like
RulesEngine.run(FactStore), and reports what the run did: the output object, the rules that fired, what each rule's condition evaluated to, the checksum of the rules the run used, and the run'stagsandstart instant. - runWithResult(FactStore<?>, RunOptions) - Method in interface io.github.brantunger.unruly.api.RulesEngine
-
Runs the rules like
RulesEngine.runWithResult(FactStore), with settings for this run only, such as atimeoutthat replaces the one the engine was built with.
S
- Session - Interface in io.github.brantunger.unruly.api.language
-
A language's state for one run of a rule list at a time, such as a single-threaded interpreter context.
- set(Map<String, ? extends Object>) - Static method in class io.github.brantunger.unruly.api.language.ActionResult
-
Returns the result of an action that produced properties for the engine to set on the output object.
- set(O, String, Object) - Method in interface io.github.brantunger.unruly.api.OutputWriter
-
Sets one property on the output object.
- set(O, String, Object, OutputConverter) - Method in interface io.github.brantunger.unruly.api.OutputWriter
-
Sets one property on the output object, given a converter for the value from the rule's expression language.
- setBalance(long) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Account
-
Sets the account's balance.
- setCreditScore(int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.WritableApplicant
-
Sets the applicant's credit score, which no condition may do.
- setName(String) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Customer
-
Sets the customer's name.
- setValue(String, T) - Method in class io.github.brantunger.unruly.api.FactMap
-
Sets the value of the named fact by storing a new
Fact. - setValue(String, T) - Method in interface io.github.brantunger.unruly.api.FactStore
-
Sets the value of the named fact.
- severity() - Method in record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Returns the value of the
severityrecord component. - sharedStateEquals(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that is true when the shared state
ExpressionLanguageContractTest.changeSharedState(java.lang.String, int)changes holdsvalue, and false, without failing, while it doesn't. - size() - Method in class io.github.brantunger.unruly.api.FactMap
- SKIPPED - Enum constant in enum class io.github.brantunger.unruly.api.RuleEvaluation.Outcome
-
The run skipped the rule without evaluating its condition: the rule is
disabled, outside itsvalidity windowwhen the run started, or carries none of the tags the run wasgiven. - startedAt() - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns when the run started, by the engine's
RulesEngineBuilder.clock(...): the one instant the run read from it, which judged every rule'svalidFromandvalidTo, and which the run's listeners get asRunContext.startedAt(). - startedAt() - Method in interface io.github.brantunger.unruly.api.RunContext
- startedAt() - Method in class io.github.brantunger.unruly.api.RunResult
-
Returns when the run started, by the engine's clock, as
RunContext.startedAt()describes it: the instant that judged every rule's validity window. - syntaxError() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition with a syntax error.
T
- tags() - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns the tags the run was given with
RunOptions.withTags(...): the run uses only the rules that carry at least one of them, and skips the others. - tags() - Method in interface io.github.brantunger.unruly.api.RunContext
-
Returns the tags the run was given with
RunOptions.withTags(java.util.Collection): the run uses only the rules that carry at least one of them, and reports the others asSKIPPED. - tags() - Method in class io.github.brantunger.unruly.api.RunOptions
-
Returns the tags that choose the rules the run uses.
- tags() - Method in class io.github.brantunger.unruly.api.RunResult
-
Returns the tags the run was given, as
RunContext.tags()describes them: the run used only the rules that carry at least one of them. - tags(Collection<String>) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets the names that group the rule, replacing any set before.
- text() - Method in record class io.github.brantunger.unruly.api.language.Expression
-
Returns the value of the
textrecord component. - Throwables - Class in io.github.brantunger.unruly.api.language
-
Reads what an expression language, a rule or the application's code threw, as the engine reads it: which errors the engine rethrows unchanged, what a stack overflow looks like once the JDK or a library has wrapped it, and the message and causes of an exception the language didn't create, whose
getMessage()orgetCause()may throw. - timeLeft() - Method in interface io.github.brantunger.unruly.api.language.EvaluationContext
-
Returns how long the run has left before it must stop, measured as the engine measures it.
- timeout() - Method in class io.github.brantunger.unruly.api.RunOptions
-
Returns the timeout these options give the run.
- toBuilder() - Method in class io.github.brantunger.unruly.api.Rule
-
Returns a builder that starts with this rule's fields, to create a copy with some of them changed, such as
rule.toBuilder().priority(5).build(). - toData(Object, int) - Static method in class io.github.brantunger.unruly.api.language.FactProperties
-
Converts a record, a bean or a map into a map of its properties, for a language that reads only maps.
- toString() - Method in record class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue
-
Returns a string representation of this record class.
- toString() - Method in class io.github.brantunger.unruly.api.Fact
- toString() - Method in class io.github.brantunger.unruly.api.FactMap
- toString() - Method in class io.github.brantunger.unruly.api.language.ActionResult
- toString() - Method in class io.github.brantunger.unruly.api.language.ConditionResult
- toString() - Method in record class io.github.brantunger.unruly.api.language.Expression
-
Returns a string representation of this record class.
- toString() - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Lists every field set so far, such as
Rule.RuleBuilder(ruleName=prime-rate, condition=null, ...). - toString() - Method in class io.github.brantunger.unruly.api.Rule
-
Lists every field, such as
Rule(ruleName=prime-rate, condition=..., action=..., priority=10, description=null, language=null, enabled=true, validFrom=null, validTo=null, tags=[]). - toString() - Method in class io.github.brantunger.unruly.api.RuleEvaluation
-
Names the rule and its outcome, such as
prime-rate=MATCHED. - toString() - Method in class io.github.brantunger.unruly.api.RuleSetInfo
-
Describes the rule set, such as
RuleSetInfo(rules=[prime-rate], checksum=9f2c..., loadedAt=2027-06-01T00:00:00Z). - toString() - Method in class io.github.brantunger.unruly.api.RunOptions
-
Describes the options, such as
RunOptions(timeout=PT2S, tags=[eu, retail]). - toString() - Method in class io.github.brantunger.unruly.api.RunResult
-
Describes the result, such as
RunResult(output={rate=4.5}, firedRules=[prime-rate], evaluations=[prime-rate=MATCHED], ruleSetChecksum=9f2c..., tags=[], startedAt=2027-06-01T00:00:00Z). - toString() - Method in record class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Applicant
-
Returns a string representation of this record class.
- toString() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.WritableApplicant
-
Returns the applicant as
WritableApplicant[creditScore=750], so that a failure that names the fact says what it held. - TRUE - Static variable in class io.github.brantunger.unruly.api.language.ConditionResult
-
The result of a condition that was
true, without a detail. - truncate(String) - Static method in class io.github.brantunger.unruly.api.language.MessageText
-
Shortens text for a message to at most 1,000 characters (UTF-16 units), without escaping it.
U
- uniqueMatch(Supplier<O>) - Static method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Starts building an engine that fires the action of the one rule whose condition is true, and fails the run when more than one is: DMN's unique match, for a decision table whose rows must not overlap.
- unlimitedCopies() - Method in class io.github.brantunger.unruly.api.RulesEngineBuilder
-
Makes as many compiled copies of the rules as the runs in progress need, on any kind of thread, instead of the default limit on runs from virtual threads.
- UnrulyException - Exception Class in io.github.brantunger.unruly.api.exception
-
The base runtime exception for the Unruly engine.
- UnrulyException(String) - Constructor for exception class io.github.brantunger.unruly.api.exception.UnrulyException
-
Constructs a new exception with the specified detail message.
- UnrulyException(String, Throwable) - Constructor for exception class io.github.brantunger.unruly.api.exception.UnrulyException
-
Constructs a new exception with the specified detail message and cause.
- unusableFactName() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a fact name that rules in this language can't refer to.
- usableFactNames() - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns fact names that rules in this language can refer to, such as
credit_score2.
V
- validate(List<Rule>) - Method in interface io.github.brantunger.unruly.api.RulesEngine
-
Compiles a rule list exactly as
RulesEngine.load(List)would, with this engine's languages, imports, options and declared facts, without loading it, and returns the problemsload()would have thrown instead of throwing. - validFrom(Instant) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets when runs start to use the rule.
- validTo(Instant) - Method in class io.github.brantunger.unruly.api.Rule.RuleBuilder
-
Sets when runs stop using the rule.
- value() - Method in class io.github.brantunger.unruly.api.language.ConditionResult
-
Returns what the condition evaluated to.
- valueOf(String) - Static method in enum class io.github.brantunger.unruly.api.exception.ExpressionKind
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue.Severity
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.brantunger.unruly.api.RuleEvaluation.Outcome
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class io.github.brantunger.unruly.api.exception.ExpressionKind
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue.Severity
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Method in class io.github.brantunger.unruly.api.FactMap
- values() - Static method in enum class io.github.brantunger.unruly.api.RuleEvaluation.Outcome
-
Returns an array containing the constants of this enum class, in the order they are declared.
- variableEquals(String, int) - Method in class io.github.brantunger.unruly.test.ExpressionLanguageContractTest
-
Returns a condition that is true when a whole-number variable equals a value.
W
- warmUp(Session) - Method in interface io.github.brantunger.unruly.api.language.ExpressionCompiler
-
Prepares a new session before any run uses it, such as by compiling this compiler's expressions into it, so that the runs that use it first don't pay for that.
- warn(Expression, InvalidExpressionException.Issue) - Method in interface io.github.brantunger.unruly.api.language.CompileContext
-
Reports a problem that doesn't stop an expression compiling, such as use of a deprecated function.
- WARNING - Enum constant in enum class io.github.brantunger.unruly.api.exception.InvalidExpressionException.Issue.Severity
-
The expression compiles, but may not do what its author meant.
- Where to start - Search tag in Overview
- Section
- withRun(RunContext) - Method in class io.github.brantunger.unruly.api.RunResult
- withTags(Collection<String>) - Method in class io.github.brantunger.unruly.api.RunOptions
-
Returns a copy of these options that has the run use only the rules that carry at least one of
tags(Rule.getTags()). - withTimeout(Duration) - Method in class io.github.brantunger.unruly.api.RunOptions
-
Returns a copy of these options that gives the run
timeoutinstead of the engine'srun timeout. - withTimeoutOf(Duration) - Static method in class io.github.brantunger.unruly.api.RunOptions
-
Returns options that give the run
timeoutinstead of the engine'srun timeout. - WritableApplicant(int) - Constructor for class io.github.brantunger.unruly.test.ExpressionLanguageContractTest.WritableApplicant
-
Creates the applicant.
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form