Class ProductCharacteristicValue
- All Implemented Interfaces:
Serializable
ProductCharacteristicValue to a CharacteristicValue primarily for syncing
translations between the domains.- Since:
- Catalog Service 2.2.0, Release Train 2.2.0
- Author:
- Julia Lopez-Pozas (jlopezpozas)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanAdditional custom attributes associated with extensions and complex value types, e.g., enum, variant option.getLabel()The label of the characteristic value.The sourceCharacteristicValue.getId()that this current value is derived from, if any.getValue()The value of the characteristic for this product.The type of this value, e.g., enum, string, etc.inthashCode()booleanisActive()Determines if this value is active.booleanDetermines if this value is the default value for the characteristic.voidsetActive(boolean isActive) Determines if this value is active.voidsetAttributes(Map<String, Object> attributes) Additional custom attributes associated with extensions and complex value types, e.g., enum, variant option.voidsetDefault(boolean isDefault) Determines if this value is the default value for the characteristic.voidThe label of the characteristic value.voidsetSourceCharacteristicValueId(String sourceCharacteristicValueId) The sourceCharacteristicValue.getId()that this current value is derived from, if any.voidThe value of the characteristic for this product.voidsetValueType(String valueType) The type of this value, e.g., enum, string, etc.toString()
-
Constructor Details
-
ProductCharacteristicValue
public ProductCharacteristicValue()
-
-
Method Details
-
getSourceCharacteristicValueId
The source
CharacteristicValue.getId()that this current value is derived from, if any.It's possible that when a
Productis first created, it may not have anyProduct.getCharacteristics()associated to it. Alternatively, it's possible that after aProductis created and has already been assignedProduct.getCharacteristics(), the parentBusinessType.getCharacteristics()may change, and therefore theProduct.getCharacteristics()may be outdated/missing values.In such cases, it is often preferable for the API caller to engage a
synchronization process. Part of this process ensures that for anyProductCharacteristicwhich does not have anyvalues set, thevalueswill be initialized withProductCharacteristicValueinstances copied from thebase values. Because these values are copied directly from the baseCharacteristicValue, we want to also ensure that any translations for the baseCharacteristicValueare applied to theProductCharacteristicValuereplica. The mechanism to achieve this is inDefaultCharacteristicsTranslationService, where any translations tied toCharacteristicValue.getId()are mapped to theProductCharacteristicValue, and the connection between the two is handled viagetSourceCharacteristicValueId(). Note that if a translation is specified directly for theProductCharacteristicValueinstance, it will take precedence over any translation from the baseCharacteristicValue.Thus, this
getSourceCharacteristicValueId()field is primarily relevant for scenarios where theProductCharacteristicValueis directly copied from a value set in the baseCharacteristicValue, and should also inherit translations from that base value. In a scenario where theProductCharacteristicValueis independently created, or overridden/changed from the baseCharacteristicValue,getSourceCharacteristicValueId()naturally does not have much importance, as the translations from the base value will not be applicable to this 'custom-defined' value.As a result, when possible, API callers should prefer to provide the
CharacteristicValue.getId()in this field if this value exactly matches the base value, and you are intending to inherit its translations. Otherwise, it can be left null, in which case thisProductCharacteristicValuewill be disconnected from anyCharacteristicValue, and not participate in any translation inheritance. -
getValue
The value of the characteristic for this product. -
getLabel
The label of the characteristic value. -
getValueType
The type of this value, e.g., enum, string, etc. -
isDefault
public boolean isDefault()Determines if this value is the default value for the characteristic.- Since:
- Catalog Service 2.2.1, Release Train 2.2.1
-
isActive
public boolean isActive()Determines if this value is active.- Since:
- Catalog Service 2.2.1, Release Train 2.2.1
-
getAttributes
Additional custom attributes associated with extensions and complex value types, e.g., enum, variant option.- Since:
- Catalog Services 2.3.0, Release Train 2.3.0
-
setSourceCharacteristicValueId
The source
CharacteristicValue.getId()that this current value is derived from, if any.It's possible that when a
Productis first created, it may not have anyProduct.getCharacteristics()associated to it. Alternatively, it's possible that after aProductis created and has already been assignedProduct.getCharacteristics(), the parentBusinessType.getCharacteristics()may change, and therefore theProduct.getCharacteristics()may be outdated/missing values.In such cases, it is often preferable for the API caller to engage a
synchronization process. Part of this process ensures that for anyProductCharacteristicwhich does not have anyvalues set, thevalueswill be initialized withProductCharacteristicValueinstances copied from thebase values. Because these values are copied directly from the baseCharacteristicValue, we want to also ensure that any translations for the baseCharacteristicValueare applied to theProductCharacteristicValuereplica. The mechanism to achieve this is inDefaultCharacteristicsTranslationService, where any translations tied toCharacteristicValue.getId()are mapped to theProductCharacteristicValue, and the connection between the two is handled viagetSourceCharacteristicValueId(). Note that if a translation is specified directly for theProductCharacteristicValueinstance, it will take precedence over any translation from the baseCharacteristicValue.Thus, this
getSourceCharacteristicValueId()field is primarily relevant for scenarios where theProductCharacteristicValueis directly copied from a value set in the baseCharacteristicValue, and should also inherit translations from that base value. In a scenario where theProductCharacteristicValueis independently created, or overridden/changed from the baseCharacteristicValue,getSourceCharacteristicValueId()naturally does not have much importance, as the translations from the base value will not be applicable to this 'custom-defined' value.As a result, when possible, API callers should prefer to provide the
CharacteristicValue.getId()in this field if this value exactly matches the base value, and you are intending to inherit its translations. Otherwise, it can be left null, in which case thisProductCharacteristicValuewill be disconnected from anyCharacteristicValue, and not participate in any translation inheritance. -
setValue
The value of the characteristic for this product. -
setLabel
The label of the characteristic value. -
setValueType
The type of this value, e.g., enum, string, etc. -
setDefault
public void setDefault(boolean isDefault) Determines if this value is the default value for the characteristic.- Since:
- Catalog Service 2.2.1, Release Train 2.2.1
-
setActive
public void setActive(boolean isActive) Determines if this value is active.- Since:
- Catalog Service 2.2.1, Release Train 2.2.1
-
setAttributes
Additional custom attributes associated with extensions and complex value types, e.g., enum, variant option.- Since:
- Catalog Services 2.3.0, Release Train 2.3.0
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-