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 booleanintcompareTo(@NonNull ContentField o) booleanWhen 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.ContextStateA subset ofTrackinginformation 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 fieldinthashCode()booleanWhether this field can source from recommendations.booleanWhether this field represents a collectionbooleanWhether this field is requiredbooleanWhether the field should be translatable.voidsetAllowedModels(List<String> allowedModels) When the `referenceType` is `CONTENT`, this field holds allowed content models.voidsetAllowRecommendationConfiguration(boolean allowRecommendationConfiguration) Whether this field can source from recommendations.voidsetAttributes(Map<String, Object> attributes) Additional attributes needed to further define this fieldvoidsetCollection(boolean collection) Whether this field represents a collectionvoidsetContentModel(ContentModel contentModel) The content model this content field belongs tovoidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetDisplayOrder(Integer displayOrder) The display order of this field in relation to other fields.voidsetHelpText(String helpText) Help text to display on the fieldvoidHint text to display below the field in the adminvoidA unique id for the field.voidThe friendly display label for this fieldvoidA unique name for the content type, used for retrieval.voidsetReferenceType(String referenceType) When the `type` is `REFERENCE`, this field holds the type of entity this field links tovoidsetRequired(boolean required) Whether this field is requiredvoidsetTranslatable(boolean translatable) Whether the field should be translatable.voidThe type of this content fieldtoString()
-
Field Details
-
COMPARATOR
-
-
Constructor Details
-
ContentField
public ContentField()
-
-
Method Details
-
compareTo
- Specified by:
compareToin 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
ContentItemlevel. 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 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
-
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
ContentItemlevel. 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 ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-