Class DefaultRAOLookupService
- java.lang.Object
-
- de.hybris.platform.ruleengineservices.rule.evaluation.actions.impl.DefaultRAOLookupService
-
- All Implemented Interfaces:
RAOLookupService
public class DefaultRAOLookupService extends java.lang.Object implements RAOLookupService
Default implementation ofRAOLookupService
-
-
Constructor Summary
Constructors Constructor Description DefaultRAOLookupService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.drools.core.spi.KnowledgeHelpercheckAndGetRuleContext(RuleActionContext context)Checks that the givenruleContextis of typeKnowledgeHelper(i.e.<T> java.util.Optional<T>lookupRAOByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)Performs lookup for the RAO object identified by its type within providedRuleActionContext<T> java.util.List<T>lookupRAOObjectsByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)Performs lookup for the RAO objects identified by its type within providedRuleActionContext
-
-
-
Method Detail
-
lookupRAOByType
public <T> java.util.Optional<T> lookupRAOByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)Description copied from interface:RAOLookupServicePerforms lookup for the RAO object identified by its type within providedRuleActionContext- Specified by:
lookupRAOByTypein interfaceRAOLookupService- Type Parameters:
T- expected RAO object type- Parameters:
raoType- class type of RAO objects to look forcontext- instance ofRuleActionContextraoFilters- optional set ofPredicateto perform filtering against found RAO objects- Returns:
- RAO object wrapped in
Optional, orOptional.empty()in case no RAO object found that meets lookup and filtering criteria
-
lookupRAOObjectsByType
public <T> java.util.List<T> lookupRAOObjectsByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)Description copied from interface:RAOLookupServicePerforms lookup for the RAO objects identified by its type within providedRuleActionContext- Specified by:
lookupRAOObjectsByTypein interfaceRAOLookupService- Type Parameters:
T- expected RAO object type- Parameters:
raoType- class type of RAO objects to look forcontext- instance ofRuleActionContextraoFilters- optional set ofPredicateto perform filtering against found RAO objects- Returns:
- list of found RAO objects that satisfy lookup criteria, or
Collections.emptyList()
-
checkAndGetRuleContext
protected org.drools.core.spi.KnowledgeHelper checkAndGetRuleContext(RuleActionContext context)
Checks that the givenruleContextis of typeKnowledgeHelper(i.e. drools-specific)- Parameters:
context- the RuleActionContext instance- Returns:
- the
KnowledgeHelper
-
-