Class Translation
- All Implemented Interfaces:
 com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable,com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable
 Defines an entity that holds the value for a translation of a String field on another
 entity in a particular Locale. This is used to override the default value of that field
 in a matching locale.
 
Translations are designed to be unique per locale, entityType, entityId and entityField within a particular tenant context.
- Author:
 - Nathan Moore (nathandmoore)
 - See Also:
 
- 
Constructor Summary
ConstructorsConstructorDescriptionTranslation(String entityField, Object value) Convenience constructor for commonly used entity field, value combination.Translation(String id, String entityField, Object value) Convenience constructor for commonly used id, field, value combination.Translation(String id, Locale locale, String entityType, String entityId, String entityField, Object value)  - 
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleancom.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.The name of the field on the entity to which this translation applies.The ID of the entity to which this translation applies.The type of the entity to which this translation applies represented by the repository domain class name.getId()The context ID of this TranslationTheLocalewherein this Translation is applicablecom.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainerOptional.A type hint for this translation entity.getValue()This field holds the actual translated value.inthashCode()voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) voidsetEntityField(String entityField) The name of the field on the entity to which this translation applies.voidsetEntityId(String entityId) The ID of the entity to which this translation applies.voidsetEntityType(String entityType) The type of the entity to which this translation applies represented by the repository domain class name.voidThe context ID of this TranslationvoidTheLocalewherein this Translation is applicablevoidsetOverrideChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer) Optional.voidsetTypeHint(String typeHint) A type hint for this translation entity.voidThis field holds the actual translated value.toString() 
- 
Constructor Details
- 
Translation
 - 
Translation
Convenience constructor for commonly used id, field, value combination. Primarily in the context of tests.- Parameters:
 id- - the translation identityField- - the entity field to translatevalue- - the translation value.
 - 
Translation
Convenience constructor for commonly used entity field, value combination. Primarily in the context of tests.- Parameters:
 entityField- - the entity field to translatevalue- - the translation value.
 - 
Translation
public Translation() 
 - 
 - 
Method Details
- 
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) - Specified by:
 setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
 - 
getId
The context ID of this Translation- Returns:
 - The context ID of this Translation
 
 - 
getLocale
TheLocalewherein this Translation is applicable- Returns:
 - The 
Localewherein this Translation is applicable. 
 - 
getEntityType
The type of the entity to which this translation applies represented by the repository domain class name.- Returns:
 - The type of the entity to which this translation applies represented by the repository domain class name.
 
 - 
getEntityId
The ID of the entity to which this translation applies.- Returns:
 - The ID of the entity to which this translation applies.
 
 - 
getEntityField
The name of the field on the entity to which this translation applies.- Returns:
 - The name of the field on the entity to which this translation applies.
 
 - 
getValue
This field holds the actual translated value. This is anObjectto allow flexibility for what can be translated (ex: aStringor aListofStrings). This should ideally match the type of the value held byentityField.Note, however, that for certain value types, there may be type mismatches with
entityFieldonce Jackson deserializes thevaluereceived in a request. For example, if a JSON array is received as the value, Jackson will simply deserialize it to aList. If yourentityFieldwas of typeSet, it would produce an error inTranslationPostMapperMemberwhen the value needed to be copied into the entity. Custom deserialization or custom translation logic inTranslationPostMapperMembermay be used to resolve these differences.- Returns:
 - the actual translated value
 - See Also:
 
 - 
getTypeHint
A type hint for this translation entity. This field indicates what kind of entity this translation belongs to. This is not populated by default, and is not persisted. In the case that it is needed, it is up to a service to manually populate this value. - 
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
 getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
 - a subset of 
Trackinginformation to expose the context state for this object 
 - 
getOverrideChangeContainer
public com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer getOverrideChangeContainer()Optional. The override change container that should be used when mapping over the projection domain to set the change container for the repository domain. This is typically useful in bulk operations like import.- Specified by:
 getOverrideChangeContainerin interfacecom.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
 - 
setId
The context ID of this Translation- Parameters:
 id- The context ID of this Translation
 - 
setLocale
TheLocalewherein this Translation is applicable- Parameters:
 locale- TheLocalewherein this Translation is applicable.
 - 
setEntityType
The type of the entity to which this translation applies represented by the repository domain class name.- Parameters:
 entityType- The type of the entity to which this translation applies represented by the repository domain class name. CATEGORY, OFFER.
 - 
setEntityId
The ID of the entity to which this translation applies.- Parameters:
 entityId- The ID of the entity to which this translation applies.
 - 
setEntityField
The name of the field on the entity to which this translation applies.- Parameters:
 entityField- The name of the field on the entity to which this translation applies.
 - 
setValue
This field holds the actual translated value. This is anObjectto allow flexibility for what can be translated (ex: aStringor aListofStrings). This should ideally match the type of the value held byentityField.Note, however, that for certain value types, there may be type mismatches with
entityFieldonce Jackson deserializes thevaluereceived in a request. For example, if a JSON array is received as the value, Jackson will simply deserialize it to aList. If yourentityFieldwas of typeSet, it would produce an error inTranslationPostMapperMemberwhen the value needed to be copied into the entity. Custom deserialization or custom translation logic inTranslationPostMapperMembermay be used to resolve these differences.- Parameters:
 value- the actual translated value- See Also:
 
 - 
setTypeHint
A type hint for this translation entity. This field indicates what kind of entity this translation belongs to. This is not populated by default, and is not persisted. In the case that it is needed, it is up to a service to manually populate this value. - 
setOverrideChangeContainer
public void setOverrideChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer) Optional. The override change container that should be used when mapping over the projection domain to set the change container for the repository domain. This is typically useful in bulk operations like import.- Specified by:
 setOverrideChangeContainerin interfacecom.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
 - 
equals
 - 
canEqual
 - 
hashCode
public int hashCode() - 
toString
 
 -