java.lang.Object
org.evrete.AbstractRule
- All Implemented Interfaces:
Environment,FluentEnvironment<Rule>,Named,NamedType.Resolver,Rule
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRule(String name) protectedAbstractRule(AbstractRule other, String ruleName, int salience) -
Method Summary
Modifier and TypeMethodDescriptionvoidchainRhs(Consumer<RhsContext> consumer) Chains a consumer to the current RHS logic.final <T> TRetrieves the value of a property by its name.final StringgetName()Returns the name of the object.Retrieves a collection of all property names in the environment.getRhs()Gets the RHS (Right Hand Side) logic as a Consumer.final intRetrieves the rule's salience.Sets the specified property to the given value.voidSets a new name for the rule.voidSets the RHS logic using a literal string.voidsetRhs(Consumer<RhsContext> rhs) Sets the RHS logic using a Consumer.voidsetSalience(int salience) Sets the rule's salience.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.evrete.api.Environment
getMethods inherited from interface org.evrete.api.NamedType.Resolver
getDeclaredFactTypes, resolve
-
Field Details
-
NULL_SALIENCE
public static final int NULL_SALIENCE- See Also:
-
rhs
-
-
Constructor Details
-
AbstractRule
-
AbstractRule
-
-
Method Details
-
getRhs
Description copied from interface:RuleGets the RHS (Right Hand Side) logic as a Consumer. -
setRhs
Description copied from interface:RuleSets the RHS logic using a Consumer. Can be null. -
setRhs
Description copied from interface:RuleSets the RHS logic using a literal string. The literal will be compiled and converted into a Consumer. -
getPropertyNames
Description copied from interface:EnvironmentRetrieves a collection of all property names in the environment.- Specified by:
getPropertyNamesin interfaceEnvironment- Returns:
- A collection of strings representing all property names in the environment.
-
getLiteralRhs
-
getSalience
public final int getSalience()Description copied from interface:RuleRetrieves the rule's salience.- Specified by:
getSaliencein interfaceRule- Returns:
- the salience value.
-
setSalience
public void setSalience(int salience) Description copied from interface:RuleSets the rule's salience.- Specified by:
setSaliencein interfaceRule- Parameters:
salience- the salience value to set.
-
set
Description copied from interface:FluentEnvironmentSets the specified property to the given value.- Specified by:
setin interfaceEnvironment- Specified by:
setin interfaceFluentEnvironment<Rule>- Parameters:
property- the name of the property to set; should not benull.value- the new value for the property; the actual type is determined by the implementation and the property being set.- Returns:
- the current instance of
Xto allow for method chaining.
-
get
Description copied from interface:EnvironmentRetrieves the value of a property by its name.- Specified by:
getin interfaceEnvironment- Type Parameters:
T- The expected type of the property value.- Parameters:
property- The name of the property to retrieve.- Returns:
- The value of the property as type T, or
nullif it does not exist.
-
getName
Description copied from interface:NamedReturns the name of the object. -
setName
Description copied from interface:RuleSets a new name for the rule. -
chainRhs
Description copied from interface:RuleChains a consumer to the current RHS logic. The provided consumer is executed after the current RHS.
-