Class Translation
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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information 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, e.g., PRODUCT, CATEGORY, OFFER.getId()
The context ID of this TranslationTheLocale
wherein this Translation is applicableThe type hint for this translation.getValue()
This field holds the actual translated value.int
hashCode()
void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setEntityField
(String entityField) The name of the field on the entity to which this translation applies.void
setEntityId
(String entityId) The ID of the entity to which this translation applies.void
setEntityType
(String entityType) The type of the entity to which this translation applies, e.g., PRODUCT, CATEGORY, OFFER.void
The context ID of this Translationvoid
TheLocale
wherein this Translation is applicablevoid
setTypeHint
(String typeHint) The type hint for this translation.void
This field holds the actual translated value.toString()
-
Constructor Details
-
Translation
-
Translation
public Translation()
-
-
Method Details
-
getId
The context ID of this Translation- Returns:
- The context ID of this Translation
-
getLocale
TheLocale
wherein this Translation is applicable- Returns:
- The
Locale
wherein this Translation is applicable.
-
getEntityType
The type of the entity to which this translation applies, e.g., PRODUCT, CATEGORY, OFFER.- Returns:
- The type of the entity to which this translation applies, e.g., PRODUCT, CATEGORY, OFFER.
-
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 anObject
to allow flexibility for what can be translated (ex: aString
or aList
ofStrings
). This should ideally match the type of the value held byentityField
.Note, however, that for certain value types, there may be type mismatches with
entityField
once Jackson deserializes thevalue
received in a request. For example, if a JSON array is received as the value, Jackson will simply deserialize it to aList
.- Returns:
- the actual translated value
-
getTypeHint
The type hint for this translation. -
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTracking
information to expose the context state for this object.- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
setId
The context ID of this Translation- Parameters:
id
- The context ID of this Translation
-
setLocale
TheLocale
wherein this Translation is applicable- Parameters:
locale
- TheLocale
wherein this Translation is applicable.
-
setEntityType
The type of the entity to which this translation applies, e.g., PRODUCT, CATEGORY, OFFER.- Parameters:
entityType
- The type of the entity to which this translation applies, e.g., PRODUCT, 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 anObject
to allow flexibility for what can be translated (ex: aString
or aList
ofStrings
). This should ideally match the type of the value held byentityField
.Note, however, that for certain value types, there may be type mismatches with
entityField
once Jackson deserializes thevalue
received in a request. For example, if a JSON array is received as the value, Jackson will simply deserialize it to aList
.- Parameters:
value
- the actual translated value
-
setTypeHint
The type hint for this translation. -
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-