Interface MatchingProductFinder
- 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.
The functional method of this interface is
findMatchingProduct(IConfigurableModelObject, List, List).
- Since:
- 23.6
-
Method Summary
Modifier and TypeMethodDescriptionfindMatchingProduct(IConfigurableModelObject modelObject, List<IProductComponent> oldProducts, List<IProductComponent> newProducts) This method returns aProductFinderResultobject which contains the correct replacement of anIProductComponentfor the givenIConfigurableModelObject.default MatchingProductFinderor(MatchingProductFinder other) Returns a composed product finder that represents a short-circuiting logical OR of this product finder and another.
-
Method Details
-
findMatchingProduct
ProductFinderResult findMatchingProduct(IConfigurableModelObject modelObject, List<IProductComponent> oldProducts, List<IProductComponent> newProducts) 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(MatchingProductFinder)method, the error result will stop the chain, while the empty result will delegate finding a replacement to the next finder.- Parameters:
modelObject- the model object that should be switched to a newIProductComponentoldProducts- a list ofIProductComponentobjects found in the product configuration of the model objectnewProducts- a list ofIProductComponentobjects found in the product configuration of the newIProductComponent- Returns:
- a suitable replacement for the given model object from the
newProductslist or an explanation 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 another. 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
-