Interface AttributeDefinitionDraft
- All Superinterfaces:
Draft<AttributeDefinitionDraft>
Specify the Attribute to be created with the ProductTypeDraft.
Example to create an instance using the builder pattern
AttributeDefinitionDraft attributeDefinitionDraft = AttributeDefinitionDraft.builder()
.type(typeBuilder -> typeBuilder)
.name("{name}")
.label(labelBuilder -> labelBuilder)
.isRequired(true)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for AttributeDefinitionDraftbuilder(AttributeDefinitionDraft template) create builder for AttributeDefinitionDraft instancecopyDeep()static AttributeDefinitionDraftdeepCopy(AttributeDefinitionDraft template) factory method to create a deep copy of AttributeDefinitionDraftSpecifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).@Valid LocalizedStringProvides additional information about the Attribute that aids content managers when setting Product details.@NotNull BooleanSet totrueif the Attribute is required to have a value on a ProductVariant.Set astrueif you want the Attribute's values to be available in the Product Search or the Product Projection Search API and can be used in full-text search queries, filters, and facets.@NotNull @Valid LocalizedStringgetLabel()Human-readable label for the Attribute.getLevel()Specifies whether the Attribute is defined at the Product or Variant level.@NotNull StringgetName()User-defined name of the Attribute that is unique to the Project.@NotNull @Valid AttributeTypegetType()Describes the Type of the Attribute.static AttributeDefinitionDraftof()factory methodstatic AttributeDefinitionDraftof(AttributeDefinitionDraft template) factory method to create a shallow copy AttributeDefinitionDraftvoidsetAttributeConstraint(AttributeConstraintEnum attributeConstraint) Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.voidsetInputHint(TextInputHint inputHint) Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).voidsetInputTip(LocalizedString inputTip) Provides additional information about the Attribute that aids content managers when setting Product details.voidsetIsRequired(Boolean isRequired) Set totrueif the Attribute is required to have a value on a ProductVariant.voidsetIsSearchable(Boolean isSearchable) Set astrueif you want the Attribute's values to be available in the Product Search or the Product Projection Search API and can be used in full-text search queries, filters, and facets.voidsetLabel(LocalizedString label) Human-readable label for the Attribute.voidsetLevel(AttributeLevelEnum level) Specifies whether the Attribute is defined at the Product or Variant level.voidUser-defined name of the Attribute that is unique to the Project.voidsetType(AttributeType type) Describes the Type of the Attribute.static com.fasterxml.jackson.core.type.TypeReference<AttributeDefinitionDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map function
-
Method Details
-
getType
Describes the Type of the Attribute.
When the
typeis different for an AttributeDefinition using the same name in multiple ProductTypes, an AttributeDefinitionTypeConflict error is returned.- Returns:
- type
-
getName
User-defined name of the Attribute that is unique to the Project.
When using the same
namefor an Attribute in multiple ProductTypes, all fields of the AttributeDefinition of this Attribute must be the same across the ProductTypes, else an AttributeDefinitionAlreadyExists error is returned. An exception to this are the values of anenumorlenumType and sets thereof.- Returns:
- name
-
getLabel
Human-readable label for the Attribute.
- Returns:
- label
-
getIsRequired
Set to
trueif the Attribute is required to have a value on a ProductVariant.- Returns:
- isRequired
-
getLevel
AttributeLevelEnum getLevel()Specifies whether the Attribute is defined at the Product or Variant level.
- Returns:
- level
-
getAttributeConstraint
AttributeConstraintEnum getAttributeConstraint()Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product. If the Attribute is defined at Product level, then
attributeConstraintmust beNone. Otherwise, an InvalidOperation error is returned.- Returns:
- attributeConstraint
-
getInputTip
Provides additional information about the Attribute that aids content managers when setting Product details.
- Returns:
- inputTip
-
getInputHint
TextInputHint getInputHint()Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).
- Returns:
- inputHint
-
getIsSearchable
Boolean getIsSearchable()Set as
trueif you want the Attribute's values to be available in the Product Search or the Product Projection Search API and can be used in full-text search queries, filters, and facets. If an Attribute'slevelis set asProduct, then Product Projection Search does not support the Attribute.Which exact features are available with this flag depends on the specific AttributeType. The maximum size of a searchable field is restricted by the Field content size limit. This constraint is enforced at both Product creation and Product update. If the length of the input exceeds the maximum size, an InvalidField error is returned.
- Returns:
- isSearchable
-
setType
Describes the Type of the Attribute.
When the
typeis different for an AttributeDefinition using the same name in multiple ProductTypes, an AttributeDefinitionTypeConflict error is returned.- Parameters:
type- value to be set
-
setName
User-defined name of the Attribute that is unique to the Project.
When using the same
namefor an Attribute in multiple ProductTypes, all fields of the AttributeDefinition of this Attribute must be the same across the ProductTypes, else an AttributeDefinitionAlreadyExists error is returned. An exception to this are the values of anenumorlenumType and sets thereof.- Parameters:
name- value to be set
-
setLabel
Human-readable label for the Attribute.
- Parameters:
label- value to be set
-
setIsRequired
Set to
trueif the Attribute is required to have a value on a ProductVariant.- Parameters:
isRequired- value to be set
-
setLevel
Specifies whether the Attribute is defined at the Product or Variant level.
- Parameters:
level- value to be set
-
setAttributeConstraint
Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product. If the Attribute is defined at Product level, then
attributeConstraintmust beNone. Otherwise, an InvalidOperation error is returned.- Parameters:
attributeConstraint- value to be set
-
setInputTip
Provides additional information about the Attribute that aids content managers when setting Product details.
- Parameters:
inputTip- value to be set
-
setInputHint
Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).
- Parameters:
inputHint- value to be set
-
setIsSearchable
Set as
trueif you want the Attribute's values to be available in the Product Search or the Product Projection Search API and can be used in full-text search queries, filters, and facets. If an Attribute'slevelis set asProduct, then Product Projection Search does not support the Attribute.Which exact features are available with this flag depends on the specific AttributeType. The maximum size of a searchable field is restricted by the Field content size limit. This constraint is enforced at both Product creation and Product update. If the length of the input exceeds the maximum size, an InvalidField error is returned.
- Parameters:
isSearchable- value to be set
-
of
factory method- Returns:
- instance of AttributeDefinitionDraft
-
of
factory method to create a shallow copy AttributeDefinitionDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
AttributeDefinitionDraft copyDeep() -
deepCopy
factory method to create a deep copy of AttributeDefinitionDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for AttributeDefinitionDraft- Returns:
- builder
-
builder
create builder for AttributeDefinitionDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withAttributeDefinitionDraft
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-