Class ContentField
java.lang.Object
com.broadleafcommerce.content.domain.ContentField
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,Serializable
,Comparable<ContentField>
public class ContentField
extends Object
implements Serializable, Comparable<ContentField>, com.broadleafcommerce.data.tracking.core.ContextStateAware
Represents the definition of a
FieldData
. This includes its type and other metadata.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
int
compareTo
(@NonNull ContentField o) boolean
When the `referenceType` is `CONTENT`, this field holds allowed content models.Additional attributes needed to further define this fieldThe content model this content field belongs tocom.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.The display order of this field in relation to other fields.Help text to display on the fieldgetHint()
Hint text to display below the field in the admingetId()
A unique id for the field.getLabel()
The friendly display label for this fieldgetName()
A unique name for the content type, used for retrieval.When the `type` is `REFERENCE`, this field holds the type of entity this field links togetType()
The type of this content fieldint
hashCode()
boolean
Whether this field can source from recommendations.boolean
Whether this field represents a collectionboolean
Whether this field is requiredboolean
Whether the field should be translatable.void
setAllowedModels
(List<String> allowedModels) When the `referenceType` is `CONTENT`, this field holds allowed content models.void
setAllowRecommendationConfiguration
(boolean allowRecommendationConfiguration) Whether this field can source from recommendations.void
setAttributes
(Map<String, Object> attributes) Additional attributes needed to further define this fieldvoid
setCollection
(boolean collection) Whether this field represents a collectionvoid
setContentModel
(ContentModel contentModel) The content model this content field belongs tovoid
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setDisplayOrder
(Integer displayOrder) The display order of this field in relation to other fields.void
setHelpText
(String helpText) Help text to display on the fieldvoid
Hint text to display below the field in the adminvoid
A unique id for the field.void
The friendly display label for this fieldvoid
A unique name for the content type, used for retrieval.void
setReferenceType
(String referenceType) When the `type` is `REFERENCE`, this field holds the type of entity this field links tovoid
setRequired
(boolean required) Whether this field is requiredvoid
setTranslatable
(boolean translatable) Whether the field should be translatable.void
The type of this content fieldtoString()
-
Field Details
-
COMPARATOR
-
-
Constructor Details
-
ContentField
public ContentField()
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ContentField>
-
getId
A unique id for the field.- Returns:
- the unique id for the field
-
getContentModel
The content model this content field belongs to- Returns:
- the content model this field belongs to
-
getLabel
The friendly display label for this field- Returns:
- a friendly display label for this field
-
getName
A unique name for the content type, used for retrieval.- Returns:
- a unique name for the content type, used for retrieval
-
getType
The type of this content field- Returns:
- the type of this field
-
getReferenceType
When the `type` is `REFERENCE`, this field holds the type of entity this field links to- Returns:
- the type of this field's entity reference
-
getAllowedModels
When the `referenceType` is `CONTENT`, this field holds allowed content models. If empty, allows all.- Returns:
- the allowed content models this field can reference
-
isAllowRecommendationConfiguration
public boolean isAllowRecommendationConfiguration()Whether this field can source from recommendations.Configurable at the
ContentItem
level. Only Product Reference type field can be configured with recommendations.- Returns:
- if the field can source from recommendations
-
isCollection
public boolean isCollection()Whether this field represents a collection- Returns:
- if the field is a collection
-
isRequired
public boolean isRequired()Whether this field is required- Returns:
- if the field is required
-
getHelpText
Help text to display on the field- Returns:
- help text to display on the field
-
getHint
Hint text to display below the field in the admin- Returns:
- hint text to display below the field in the admin
-
getDisplayOrder
The display order of this field in relation to other fields.- Returns:
- The display order of this field in relation to other fields.
-
isTranslatable
public boolean isTranslatable()Whether the field should be translatable.- Returns:
- Whether the field should be translatable.
-
getAttributes
Additional attributes needed to further define this field- Returns:
- additional attributes needed to further define this field
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
setId
A unique id for the field.- Parameters:
id
- the unique id for the field
-
setContentModel
The content model this content field belongs to- Parameters:
contentModel
- this content field belongs to
-
setLabel
The friendly display label for this field- Parameters:
label
- a friendly display label for this field
-
setName
A unique name for the content type, used for retrieval.- Parameters:
name
- a unique name for the content type, used for retrieval
-
setType
The type of this content field- Parameters:
type
- the type of this field
-
setReferenceType
When the `type` is `REFERENCE`, this field holds the type of entity this field links to- Parameters:
referenceType
- the type of this field's entity reference
-
setAllowedModels
When the `referenceType` is `CONTENT`, this field holds allowed content models. If empty, allows all.- Parameters:
allowedModels
- the allowed content models this field can reference
-
setAllowRecommendationConfiguration
public void setAllowRecommendationConfiguration(boolean allowRecommendationConfiguration) Whether this field can source from recommendations.Configurable at the
ContentItem
level. Only Product Reference type field can be configured with recommendations.- Parameters:
allowRecommendationConfiguration
- if the field can source from recommendations
-
setCollection
public void setCollection(boolean collection) Whether this field represents a collection- Parameters:
isCollection
- if the field is a collection
-
setRequired
public void setRequired(boolean required) Whether this field is required- Parameters:
required
- if the field is required
-
setHelpText
Help text to display on the field- Parameters:
helpText
- text to display on the field
-
setHint
Hint text to display below the field in the admin- Parameters:
hint
- text to display below the field in the admin
-
setDisplayOrder
The display order of this field in relation to other fields.- Parameters:
displayOrder
- The display order of this field in relation to other fields.
-
setTranslatable
public void setTranslatable(boolean translatable) Whether the field should be translatable.- Parameters:
translatable
- Whether the field should be translatable.
-
setAttributes
Additional attributes needed to further define this field- Parameters:
attributes
- additional information used by this field
-
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.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-