Package org.drools.base.rule.constraint
Interface Constraint
-
- All Superinterfaces:
java.lang.Cloneable,java.io.Externalizable,RuleComponent,java.io.Serializable
- All Known Subinterfaces:
AlphaNodeFieldConstraint,BetaNodeFieldConstraint,IndexableConstraint,IntervalProviderConstraint
- All Known Implementing Classes:
MutableTypeConstraint,NegConstraint,PredicateConstraint,QueryNameConstraint,XpathConstraint
public interface Constraint extends RuleComponent, java.io.Externalizable, java.lang.Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classConstraint.ConstraintTypeAn enum for Constraint Types
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddPackageNames(java.util.Collection<java.lang.String> otherPkgs)Constraintclone()Clones the constraintdefault booleanequals(java.lang.Object object, RuleBase kbase)default org.drools.core.util.bitmask.BitMaskgetListenedPropertyMask(java.util.Optional<Pattern> pattern, ObjectType objectType, java.util.List<java.lang.String> settableProperties)Returns property reactivity BitMask of this constraint.default org.drools.core.util.bitmask.BitMaskgetListenedPropertyMask(ObjectType objectType, java.util.List<java.lang.String> settableProperties)default java.util.Collection<java.lang.String>getPackageNames()Declaration[]getRequiredDeclarations()Returns all the declarations required by the given constraint implementation.Constraint.ConstraintTypegetType()Returns the type of the constraint, either ALPHA, BETA or UNKNOWNbooleanisTemporal()Returns true in case this constraint is a temporal constraintdefault voidmergeEvaluationContext(Constraint other)default voidregisterEvaluationContext(RuleBuildContext ruleBuildContext)voidreplaceDeclaration(Declaration oldDecl, Declaration newDecl)When a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch.
-
-
-
Method Detail
-
getRequiredDeclarations
Declaration[] getRequiredDeclarations()
Returns all the declarations required by the given constraint implementation.- Returns:
-
replaceDeclaration
void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
When a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch. Since this is done at ReteOO build type, when constraints were already created, eventually some constraints need to update their references to the declarations.- Parameters:
oldDecl-newDecl-
-
clone
Constraint clone()
Clones the constraint- Returns:
-
getType
Constraint.ConstraintType getType()
Returns the type of the constraint, either ALPHA, BETA or UNKNOWN- Returns:
-
isTemporal
boolean isTemporal()
Returns true in case this constraint is a temporal constraint- Returns:
-
getListenedPropertyMask
default org.drools.core.util.bitmask.BitMask getListenedPropertyMask(ObjectType objectType, java.util.List<java.lang.String> settableProperties)
-
getListenedPropertyMask
default org.drools.core.util.bitmask.BitMask getListenedPropertyMask(java.util.Optional<Pattern> pattern, ObjectType objectType, java.util.List<java.lang.String> settableProperties)
Returns property reactivity BitMask of this constraint.- Parameters:
pattern- which this constraint belongs to. if pattern is empty, bind variables are considered to be declared in the same pattern. It should be fine for alpha constraintsobjectType-settableProperties-- Returns:
- property reactivity BitMask
-
equals
default boolean equals(java.lang.Object object, RuleBase kbase)
-
registerEvaluationContext
default void registerEvaluationContext(RuleBuildContext ruleBuildContext)
-
mergeEvaluationContext
default void mergeEvaluationContext(Constraint other)
-
getPackageNames
default java.util.Collection<java.lang.String> getPackageNames()
-
addPackageNames
default void addPackageNames(java.util.Collection<java.lang.String> otherPkgs)
-
-