Interface AttributeDefinition
Example to create an instance using the builder pattern
AttributeDefinition attributeDefinition = AttributeDefinition.builder()
.type(typeBuilder -> typeBuilder)
.name("{name}")
.label(labelBuilder -> labelBuilder)
.isRequired(true)
.attributeConstraint(AttributeConstraintEnum.NONE)
.inputTip(inputTipBuilder -> inputTipBuilder)
.inputHint(TextInputHint.SINGLE_LINE)
.isSearchable(true)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeDefinitionBuilderbuilder()builder factory method for AttributeDefinitionstatic AttributeDefinitionBuilderbuilder(AttributeDefinition template) create builder for AttributeDefinition instancecopyDeep()static AttributeDefinitiondeepCopy(AttributeDefinition template) factory method to create a deep copy of AttributeDefinition@NotNull AttributeConstraintEnum@NotNull TextInputHint@NotNull @Valid LocalizedString@NotNull BooleanWhether the attribute is required to have a value.@NotNull BooleanWhether the attribute's values should generally be enabled in product search.@NotNull @Valid LocalizedStringgetLabel()@NotNull StringgetName()The unique name of the attribute used in the API.@NotNull @Valid AttributeTypegetType()static AttributeDefinitionof()factory methodstatic AttributeDefinitionof(AttributeDefinition template) factory method to create a shallow copy AttributeDefinitionvoidsetAttributeConstraint(AttributeConstraintEnum attributeConstraint) set attributeConstraintvoidsetInputHint(TextInputHint inputHint) set inputHintvoidsetInputTip(LocalizedString inputTip) set inputTipvoidsetIsRequired(Boolean isRequired) Whether the attribute is required to have a value.voidsetIsSearchable(Boolean isSearchable) Whether the attribute's values should generally be enabled in product search.voidsetLabel(LocalizedString label) set labelvoidThe unique name of the attribute used in the API.voidsetType(AttributeType type) set typestatic com.fasterxml.jackson.core.type.TypeReference<AttributeDefinition>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithAttributeDefinition(Function<AttributeDefinition, T> helper) accessor map function
-
Method Details
-
getType
- Returns:
- type
-
getName
The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (
_) and the hyphen-minus (-). When using the samenamefor an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of anenumorlenumtype and sets thereof.- Returns:
- name
-
getLabel
- Returns:
- label
-
getIsRequired
Whether the attribute is required to have a value.
- Returns:
- isRequired
-
getAttributeConstraint
- Returns:
- attributeConstraint
-
getInputTip
- Returns:
- inputTip
-
getInputHint
- Returns:
- inputHint
-
getIsSearchable
Whether the attribute's values should generally be enabled in product search. This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets & filters as part of product search queries. The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there. The max size of a searchable field is restricted to 10922 characters. 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
set type- Parameters:
type- value to be set
-
setName
The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (
_) and the hyphen-minus (-). When using the samenamefor an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of anenumorlenumtype and sets thereof.- Parameters:
name- value to be set
-
setLabel
set label- Parameters:
label- value to be set
-
setIsRequired
Whether the attribute is required to have a value.
- Parameters:
isRequired- value to be set
-
setAttributeConstraint
set attributeConstraint- Parameters:
attributeConstraint- value to be set
-
setInputTip
set inputTip- Parameters:
inputTip- value to be set
-
setInputHint
set inputHint- Parameters:
inputHint- value to be set
-
setIsSearchable
Whether the attribute's values should generally be enabled in product search. This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets & filters as part of product search queries. The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there. The max size of a searchable field is restricted to 10922 characters. 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 AttributeDefinition
-
of
factory method to create a shallow copy AttributeDefinition- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
AttributeDefinition copyDeep() -
deepCopy
factory method to create a deep copy of AttributeDefinition- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for AttributeDefinition- Returns:
- builder
-
builder
create builder for AttributeDefinition instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withAttributeDefinition
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
-