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)
.level(AttributeLevelEnum.PRODUCT)
.attributeConstraint(AttributeConstraintEnum.NONE)
.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 AttributeConstraintEnumSpecifies how Attributes are validated across all variants of a Product.@NotNull TextInputHintProvides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).@Valid LocalizedStringProvides additional Attribute information to aid content managers configure Product details.@NotNull BooleanIftrue, the Attribute must have a value on a ProductVariant.@NotNull BooleanIftrue, the Attribute's values are available in the Product Search or the Product Projection Search API for use in full-text search queries, filters, and facets.@NotNull @Valid LocalizedStringgetLabel()Human-readable label for the Attribute.@NotNull AttributeLevelEnumgetLevel()Specifies whether the Attribute is defined at the Product or Variant level.@NotNull StringgetName()User-defined name of the Attribute that is unique within the Project.@NotNull @Valid AttributeTypegetType()Describes the Type of the Attribute.static AttributeDefinitionof()factory methodstatic AttributeDefinitionof(AttributeDefinition template) factory method to create a shallow copy AttributeDefinitionvoidsetAttributeConstraint(AttributeConstraintEnum attributeConstraint) Specifies how Attributes are 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 Attribute information to aid content managers configure Product details.voidsetIsRequired(Boolean isRequired) Iftrue, the Attribute must have a value on a ProductVariant.voidsetIsSearchable(Boolean isSearchable) Iftrue, the Attribute's values are available in the Product Search or the Product Projection Search API for use 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 within the Project.voidsetType(AttributeType type) Describes the Type of the Attribute.static 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
Describes the Type of the Attribute.
- Returns:
- type
-
getName
User-defined name of the Attribute that is unique within the Project.
- Returns:
- name
-
getLabel
Human-readable label for the Attribute.
- Returns:
- label
-
getIsRequired
If
true, the Attribute must have a value on a ProductVariant.- Returns:
- isRequired
-
getLevel
Specifies whether the Attribute is defined at the Product or Variant level.
- Returns:
- level
-
getAttributeConstraint
Specifies how Attributes are validated across all variants of a Product.
- Returns:
- attributeConstraint
-
getInputTip
Provides additional Attribute information to aid content managers configure Product details.
- Returns:
- inputTip
-
getInputHint
Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).
- Returns:
- inputHint
-
getIsSearchable
If
true, the Attribute's values are available in the Product Search or the Product Projection Search API for use in full-text search queries, filters, and facets. However, if an Attribute'slevelis set asProduct, then Product Projection Search does not support the Attribute.The exact features that are available with this flag depend 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.
- Parameters:
type- value to be set
-
setName
User-defined name of the Attribute that is unique within the Project.
- Parameters:
name- value to be set
-
setLabel
Human-readable label for the Attribute.
- Parameters:
label- value to be set
-
setIsRequired
If
true, the Attribute must 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 Attributes are validated across all variants of a Product.
- Parameters:
attributeConstraint- value to be set
-
setInputTip
Provides additional Attribute information to aid content managers configure 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
If
true, the Attribute's values are available in the Product Search or the Product Projection Search API for use in full-text search queries, filters, and facets. However, if an Attribute'slevelis set asProduct, then Product Projection Search does not support the Attribute.The exact features that are available with this flag depend 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 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
-