Package org.faktorips.runtime
Interface IProductComponent
-
- All Superinterfaces:
IProductComponentLinkSource,IProductObject,IRuntimeObject
- All Known Implementing Classes:
ProductComponent
public interface IProductComponent extends IRuntimeObject, IProductObject
Interface for all product components.- Author:
- Jan Ortmann
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetDescription(java.util.Locale locale)Returns the description for this product component in the specified locale.IProductComponentGenerationgetGenerationBase(java.util.Calendar effectiveDate)Returns the generation that is effective on the given date ornullif no generation is effective on that date.java.lang.StringgetId()Returns the product component's id that uniquely identifies it in the repository it belongs to.java.lang.StringgetKindId()Returns the id of the product component kind that this product component belongs to.IProductComponentGenerationgetLatestProductComponentGeneration()Returns the latest product component generation of the provided product component ornullif non available.IRuntimeRepositorygetRepository()Returns the repository this product component belongs to.DateTimegetValidTo()Returns the date when this product component expires.IProductComponentgetVariedBase()Allows distinguishing variants not only by their product component type but also their varied base.java.lang.StringgetVersionId()Returns the version id that identifies this product component in its kind.booleanisChangingOverTime()Returnstrueif this product component hasproduct component generations.booleanisVariant()A variant is a product component that is based on another product component (hence varied base).-
Methods inherited from interface org.faktorips.runtime.IProductComponentLinkSource
getLink, getLinks
-
Methods inherited from interface org.faktorips.runtime.IProductObject
createPolicyComponent, getValidFrom, getValidFrom, isValidationRuleActivated, setValidationRuleActivated
-
Methods inherited from interface org.faktorips.runtime.IRuntimeObject
getExtensionPropertyIds, getExtensionPropertyValue
-
-
-
-
Method Detail
-
getRepository
IRuntimeRepository getRepository()
Returns the repository this product component belongs to. This method never returnsnull.- Specified by:
getRepositoryin interfaceIProductComponentLinkSource- Returns:
- The
IRuntimeRepositorythat was used to create thisIProductComponentLinkSource
-
getId
java.lang.String getId()
Returns the product component's id that uniquely identifies it in the repository it belongs to.
-
getKindId
java.lang.String getKindId()
Returns the id of the product component kind that this product component belongs to.
-
getVersionId
java.lang.String getVersionId()
Returns the version id that identifies this product component in its kind.
-
isVariant
boolean isVariant()
A variant is a product component that is based on another product component (hence varied base). It uses the varied base as a template and "changes" specific values.- Returns:
trueif this is a variant of anotherIProductComponent,falsefor regular product components.- See Also:
getVariedBase()
-
getVariedBase
IProductComponent getVariedBase()
Allows distinguishing variants not only by their product component type but also their varied base.isVariant()allows determining whether a product component is a variant.- Returns:
- the
IProductComponentthisIProductComponentis based on. Returnsnullif it is a regular product component or thevariedBasecan not be found in theIRuntimeRepository. - See Also:
isVariant(),IRuntimeRepository.getProductComponent(String)
-
getValidTo
DateTime getValidTo()
Returns the date when this product component expires. Returningnullmeans no end of the validity period.
-
getGenerationBase
IProductComponentGeneration getGenerationBase(java.util.Calendar effectiveDate)
Returns the generation that is effective on the given date ornullif no generation is effective on that date.- Throws:
java.lang.UnsupportedOperationException- if this product component has no product component generations.java.lang.NullPointerException- if effective date isnull.
-
getLatestProductComponentGeneration
IProductComponentGeneration getLatestProductComponentGeneration()
Returns the latest product component generation of the provided product component ornullif non available.- Throws:
java.lang.UnsupportedOperationException- if this product component has no product component generations.
-
isChangingOverTime
boolean isChangingOverTime()
Returnstrueif this product component hasproduct component generations.- Since:
- 3.15
-
getDescription
java.lang.String getDescription(java.util.Locale locale)
Returns the description for this product component in the specified locale. If there is no description in the specified locale, it tries to find the description in the locale's language. If there is also no description in the locale's language it returns the empty string.- Returns:
- the description for the given locale/language or an empty string if no description exists for the given locale
-
-