Class Translation
- java.lang.Object
-
- com.broadleafcommerce.search.api.domain.translation.Translation
-
public class Translation extends Object
Defines an entity that holds the value for a translation of a
Stringfield on another entity in a particularLocale. 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
Constructors Constructor Description Translation()Translation(String id, Locale locale, String entityType, String entityId, String entityField, Object value, String typeHint, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStategetContextState()A subset ofTrackinginformation to expose the context state for this object.StringgetEntityField()The name of the field on the entity to which this translation applies.StringgetEntityId()The ID of the entity to which this translation applies.StringgetEntityType()The type of the entity to which this translation applies, e.g., PRODUCT, CATEGORY, OFFER.StringgetId()The context ID of this TranslationLocalegetLocale()TheLocalewherein this Translation is applicableStringgetTypeHint()The type hint for this translation.ObjectgetValue()This field holds the actual translated value.inthashCode()voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)A subset ofTrackinginformation to expose the context state for this object.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, e.g., PRODUCT, CATEGORY, OFFER.voidsetId(String id)The context ID of this TranslationvoidsetLocale(Locale locale)TheLocalewherein this Translation is applicablevoidsetTypeHint(String typeHint)The type hint for this translation.voidsetValue(Object value)This field holds the actual translated value.StringtoString()
-
-
-
Method Detail
-
getId
public String getId()
The context ID of this Translation- Returns:
- The context ID of this Translation
-
getLocale
public Locale getLocale()
TheLocalewherein this Translation is applicable- Returns:
- The
Localewherein this Translation is applicable.
-
getEntityType
public String 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
public String getEntityId()
The ID of the entity to which this translation applies.- Returns:
- The ID of the entity to which this translation applies.
-
getEntityField
public String 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
public Object 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.- Returns:
- the actual translated value
-
getTypeHint
public String getTypeHint()
The type hint for this translation.
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
A subset ofTrackinginformation to expose the context state for this object.- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
public void setId(String id)
The context ID of this Translation- Parameters:
id- The context ID of this Translation
-
setLocale
public void setLocale(Locale locale)
TheLocalewherein this Translation is applicable- Parameters:
locale- TheLocalewherein this Translation is applicable.
-
setEntityType
public void setEntityType(String entityType)
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
public void setEntityId(String entityId)
The ID of the entity to which this translation applies.- Parameters:
entityId- The ID of the entity to which this translation applies.
-
setEntityField
public void setEntityField(String entityField)
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
public void setValue(Object value)
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.- Parameters:
value- the actual translated value
-
setTypeHint
public void setTypeHint(String typeHint)
The type hint for this translation.
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
A subset ofTrackinginformation to expose the context state for this object.- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
canEqual
protected boolean canEqual(Object other)
-
-