Class ContentField
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.ContentField
- All Implemented Interfaces:
Serializable,Comparable<ContentField>
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 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 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.voidsetAttributes(Map<String, Object> attributes) Additional attributes needed to further define this fieldvoidsetCollection(boolean collection) Whether this field represents a collectionvoidsetDisplayOrder(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
-
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
-
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
-
setId
A unique id for the field.- Parameters:
id- the unique id for the field
-
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
-
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
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-