Interface AdvancedProductFinder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
This functional interface represents an operation to find an
IProductComponent for a
given IConfigurableModelObject. Unlike the MatchingProductFinder interface, this
interface provides more options to find a replacement component.
The functional method of this interface is
findMatchingProduct(IConfigurableModelObject, IProductComponent, IConfigurableModelObject, PolicyAssociation).
- Since:
- 23.6
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AdvancedProductFinderThisAdvancedProductFinderuses theIProductComponent.getKindId()to find a suitable replacement for a product switch. -
Method Summary
Modifier and TypeMethodDescriptionfindMatchingProduct(IConfigurableModelObject parent, IProductComponent oldParentProdCmpt, IConfigurableModelObject child, PolicyAssociation parentToChild) This method returns aProductFinderResultobject which contains the correct replacement of anIProductComponentfor the givenIConfigurableModelObject.default AdvancedProductFinderor(AdvancedProductFinder other) Returns a composed product finder that represents a short-circuiting logical OR of this product finder and other product finders.
-
Field Details
-
BY_KIND_ID
ThisAdvancedProductFinderuses theIProductComponent.getKindId()to find a suitable replacement for a product switch.
-
-
Method Details
-
findMatchingProduct
ProductFinderResult findMatchingProduct(IConfigurableModelObject parent, IProductComponent oldParentProdCmpt, IConfigurableModelObject child, PolicyAssociation parentToChild) This method returns aProductFinderResultobject which contains the correct replacement of anIProductComponentfor the givenIConfigurableModelObject. Possible return values are:- the correct replacement of a
IProductComponentfor the givenIConfigurableModelObject ProductFinderResult.empty(String)if no suitable replacement was foundProductFinderResult.error(String)if no suitable replacement can be found, for example because the new parent product component has no children for the given association or there are multiple possible new targets. Details will be given in theProductFinderResult.getMessage()
If more than one finder is chained with the
or(AdvancedProductFinder)method, the error result will stop the chain, while the empty result will delegate finding a replacement to the next finder.- Parameters:
parent- the parent model objectoldParentProdCmpt- the oldIProductComponent, because theparentparameter already is set to the new product componentchild- the child object for which a newIProductComponentmust be foundparentToChild- thePolicyAssociationbetween parent and child- Returns:
- a
ProductFinderResultthat represents a suitable replacement for the given model object or explains why none was found
- the correct replacement of a
-
or
Returns a composed product finder that represents a short-circuiting logical OR of this product finder and other product finders. When evaluating the composed product finder, ifthisproduct finder is present or has an error, then theotherproduct finder is not evaluated.- Parameters:
other- a product finder that will be logically-ORed withthisproduct finder- Returns:
- the result of
thisproduct finder or if empty the result of theotherproduct finder
-