Package org.ofbiz.core.entity
Class EntityConditionHelper
java.lang.Object
org.ofbiz.core.entity.EntityConditionHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanpredicateTrueForEachLeafExpression(EntityCondition input, com.google.common.base.Predicate<EntityExpr> predicate) Traverses input EntityCondition and checks of predicate is true for each leaf EntityExpr (that does not contain sub-conditions)static EntityConditiontransformCondition(EntityCondition input, com.google.common.base.Function<EntityExpr, EntityCondition> function) Traverses input EntityCondition and each leaf EntityExpr (that does not contain sub-conditions) is transformed with function
-
Constructor Details
-
EntityConditionHelper
public EntityConditionHelper()
-
-
Method Details
-
predicateTrueForEachLeafExpression
public static boolean predicateTrueForEachLeafExpression(EntityCondition input, com.google.common.base.Predicate<EntityExpr> predicate) Traverses input EntityCondition and checks of predicate is true for each leaf EntityExpr (that does not contain sub-conditions)- Parameters:
input- EntityCondition to be checkedpredicate- to be applied to each leaf EntityExpr- Returns:
- false if at least for one EntityExpr predicate was not true
-
transformCondition
public static EntityCondition transformCondition(EntityCondition input, com.google.common.base.Function<EntityExpr, EntityCondition> function) Traverses input EntityCondition and each leaf EntityExpr (that does not contain sub-conditions) is transformed with function- Parameters:
input- EntityCondition to be transformedfunction- to be applied to each leaf EntityExpr- Returns:
- rewritten EntityCondition of the same structure except for leaf expressions transformed by function
-