Package org.faktorips.runtime
Interface IProductComponent
- All Superinterfaces:
IProductComponentLinkSource,IProductObject,IRuntimeObject
- All Known Implementing Classes:
ProductComponent
Interface for all product components.
- Author:
- Jan Ortmann
-
Field Summary
FieldsFields inherited from interface org.faktorips.runtime.IProductObject
PROPERTY_VALID_FROM -
Method Summary
Modifier and TypeMethodDescriptiongetDescription(Locale locale) Returns the description for this product component in the specified locale.getGenerationBase(Calendar effectiveDate) Returns the generation that is effective on the given date ornullif no generation is effective on that date.getId()Returns the product component's id that uniquely identifies it in the repository it belongs to.Returns the id of the product component kind that this product component belongs to.Returns the latest product component generation of the provided product component ornullif non available.default StringReturns the qualified name of this product component.Returns the repository this product component belongs to.Returns the date when this product component expires.Allows distinguishing variants not only by their product component type but also their varied base.Returns the version id that identifies this product component in its kind.booleanReturnstrueif this product component hasproduct component generations.booleanA variant is a product component that is based on another product component (hence varied base).voidsetDescription(Locale locale, String newDescriptionText) Sets or updates the description for the givenLocale.voidsetDescription(org.faktorips.values.InternationalString newDescription) Replaces the current multi-language description with the givenInternationalString.Methods inherited from interface org.faktorips.runtime.IProductComponentLinkSource
getLink, getLinksMethods inherited from interface org.faktorips.runtime.IProductObject
createPolicyComponent, getValidFrom, getValidFrom, isValidationRuleActivated, setValidationRuleActivatedMethods inherited from interface org.faktorips.runtime.IRuntimeObject
getExtensionPropertyIds, getExtensionPropertyValue
-
Field Details
-
PROPERTY_VALID_TO
- See Also:
-
-
Method Details
-
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
String getId()Returns the product component's id that uniquely identifies it in the repository it belongs to. -
getKindId
String getKindId()Returns the id of the product component kind that this product component belongs to. -
getVersionId
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
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:
-
getValidTo
DateTime getValidTo()Returns the date when this product component expires. Returningnullmeans no end of the validity period. -
getGenerationBase
Returns the generation that is effective on the given date ornullif no generation is effective on that date.- Throws:
UnsupportedOperationException- if this product component has no product component generations.NullPointerException- if effective date isnull.
-
getLatestProductComponentGeneration
IProductComponentGeneration getLatestProductComponentGeneration()Returns the latest product component generation of the provided product component ornullif non available.- Throws:
UnsupportedOperationException- if this product component has no product component generations.
-
isChangingOverTime
boolean isChangingOverTime()Returnstrueif this product component hasproduct component generations.- Since:
- 3.15
-
getDescription
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
-
setDescription
Sets or updates the description for the givenLocale.If the description for the locale already exists, it will be replaced. If no description exists, a new localized description entry will be added. If the component belongs to a read-only
IRuntimeRepository, this method will throw anIllegalRepositoryModificationException.- Parameters:
locale- the locale for which the description is to be set (must not benull)newDescriptionText- the new description text for the given locale (must not benull)- Throws:
NullPointerException- if either parameter isnullIllegalRepositoryModificationException- if the component is part of a read-only repository- Since:
- 25.7
-
setDescription
void setDescription(org.faktorips.values.InternationalString newDescription) Replaces the current multi-language description with the givenInternationalString.This method will overwrite all existing localized descriptions. If the component belongs to a read-only
IRuntimeRepository, this method will throw anIllegalRepositoryModificationException.- Parameters:
newDescription- the new internationalized description to set (must not benull)- Throws:
NullPointerException- ifnewDescriptionisnullIllegalRepositoryModificationException- if the component is part of a read-only repository- Since:
- 25.7
-
getQualifiedName
Returns the qualified name of this product component. The qualified name is the name of the file this product component is read from, relative to the repository's root, if the repository uses files - otherwise the value's definition depends on the repository implementation.The qualified name may be
nullfor newly created product components.- Returns:
- the qualified name of this product component
- Since:
- 24.1
-