Class ProductFinderResult
java.lang.Object
org.faktorips.runtime.productswitch.ProductFinderResult
Represents the result of a product finder operation, which contains the correct replacement of an
IProductComponent for the given IConfigurableModelObject.- Since:
- 23.6
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductFinderResultA newProductFinderResultthat no replacement was found.static ProductFinderResultA newProductFinderResultindicating an error while switching, for example when more than one product component was found.Returns theIProductComponentfor the replacement.booleanisEmpty()Returnstrueif the result is an empty result.booleanisError()Returnstrueif the result is anerror(String).booleanstatic ProductFinderResultof(IProductComponent productComponent) Constructs a newProductFinderResultwith the specified product component.
-
Method Details
-
of
Constructs a newProductFinderResultwith the specified product component.- Parameters:
productComponent- the correct replacement- Returns:
- a
ProductFinderResultwith the correct replacement
-
error
A newProductFinderResultindicating an error while switching, for example when more than one product component was found.If more than one finder is chained with the
MatchingProductFinder.or(MatchingProductFinder)orAdvancedProductFinder.or(AdvancedProductFinder)method, the error result will stop the evaluation.- Parameters:
message- an error message explaining why the switch failed- Returns:
- a
ProductFinderResultindicating an error
-
empty
A newProductFinderResultthat no replacement was found.If more than one finder is chained with the
MatchingProductFinder.or(MatchingProductFinder)orAdvancedProductFinder.or(AdvancedProductFinder)method, the empty result will continue to evaluate the chained product finders.- Parameters:
message- a message explaining why no replacement was found- Returns:
- a
ProductFinderResultindicating that no replacement was found
-
getProductComponent
Returns theIProductComponentfor the replacement.- Returns:
- the product component
-
isError
public boolean isError()Returnstrueif the result is anerror(String).- Returns:
trueif the result is an error
-
isEmpty
public boolean isEmpty()Returnstrueif the result is an empty result.- Returns:
trueif the result is empty
-
isPresent
public boolean isPresent()- Returns:
trueif a value is present, otherwisefalse
-
getMessage
-