Package com.embabel.agent.core
Class ComputedBooleanCondition
-
- All Implemented Interfaces:
-
com.embabel.agent.core.Condition,com.embabel.agent.core.ConditionMetadata,com.embabel.agent.core.Operation,com.embabel.common.core.types.HasInfoString,com.embabel.common.core.types.Named
public final class ComputedBooleanCondition implements Condition
Convenient class for a condition that evaluates to true or false.
-
-
Constructor Summary
Constructors Constructor Description ComputedBooleanCondition(String name, Double cost, Function2<OperationContext, Condition, Boolean> evaluator)
-
Method Summary
Modifier and Type Method Description StringgetName()DoublegetCost()Cost of evaluating the condition. ConditionDeterminationevaluate(OperationContext context)Evaluate the condition in the context of the process. StringtoString()-
-
Constructor Detail
-
ComputedBooleanCondition
ComputedBooleanCondition(String name, Double cost, Function2<OperationContext, Condition, Boolean> evaluator)
- Parameters:
evaluator- evaluation method.
-
-
Method Detail
-
getCost
Double getCost()
Cost of evaluating the condition. 0 is cheap, 1 is expensive. Helps in planning.
-
evaluate
ConditionDetermination evaluate(OperationContext context)
Evaluate the condition in the context of the process. This may be expensive, so the cost is provided. The infrastructure will attempt to call this function infrequently on expensive conditions, so there's no urgency to optimize here.
-
-
-
-