Class AttributeDefinitionDraftImpl

java.lang.Object
com.commercetools.api.models.product_type.AttributeDefinitionDraftImpl
All Implemented Interfaces:
AttributeDefinitionDraft, io.vrap.rmf.base.client.Draft<AttributeDefinitionDraft>, io.vrap.rmf.base.client.ModelBase

public class AttributeDefinitionDraftImpl extends Object implements AttributeDefinitionDraft, io.vrap.rmf.base.client.ModelBase

Specify the Attribute to be created with the ProductTypeDraft.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase

    io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
  • Constructor Summary

    Constructors
    Constructor
    Description
    create empty instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Specifies 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).
    Provides additional information about the Attribute that aids content managers when setting Product details.
    Set to true if the Attribute is required to have a value on a ProductVariant.
    Set to true if the Attribute's values should be available in the Product Projections Search API and can be used in full-text search queries, filters, and facets.
    Human-readable label for the Attribute.
    User-defined name of the Attribute that is unique with the Project.
    Describes the Type of the Attribute.
    int
     
    void
    Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.
    void
    Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).
    void
    Provides additional information about the Attribute that aids content managers when setting Product details.
    void
    setIsRequired(Boolean isRequired)
    Set to true if the Attribute is required to have a value on a ProductVariant.
    void
    setIsSearchable(Boolean isSearchable)
    Set to true if the Attribute's values should be available in the Product Projections Search API and can be used in full-text search queries, filters, and facets.
    void
    Human-readable label for the Attribute.
    void
    User-defined name of the Attribute that is unique with the Project.
    void
    Describes the Type of the Attribute.
     

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.commercetools.api.models.product_type.AttributeDefinitionDraft

    withAttributeDefinitionDraft

    Methods inherited from interface io.vrap.rmf.base.client.ModelBase

    reflectionString, reflectionString
  • Constructor Details

    • AttributeDefinitionDraftImpl

      public AttributeDefinitionDraftImpl()
      create empty instance
  • Method Details

    • getType

      public AttributeType getType()

      Describes the Type of the Attribute.

      When the type is different for an AttributeDefinition using the same name in multiple ProductTypes, an AttributeDefinitionTypeConflict error is returned.

      Specified by:
      getType in interface AttributeDefinitionDraft
      Returns:
      type
    • getName

      public String getName()

      User-defined name of the Attribute that is unique with the Project.

      When using the same name for 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 an enum or lenum Type and sets thereof.

      Specified by:
      getName in interface AttributeDefinitionDraft
      Returns:
      name
    • getLabel

      public LocalizedString getLabel()

      Human-readable label for the Attribute.

      Specified by:
      getLabel in interface AttributeDefinitionDraft
      Returns:
      label
    • getIsRequired

      public Boolean getIsRequired()

      Set to true if the Attribute is required to have a value on a ProductVariant.

      Specified by:
      getIsRequired in interface AttributeDefinitionDraft
      Returns:
      isRequired
    • getAttributeConstraint

      public AttributeConstraintEnum getAttributeConstraint()

      Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.

      Specified by:
      getAttributeConstraint in interface AttributeDefinitionDraft
      Returns:
      attributeConstraint
    • getInputTip

      public LocalizedString getInputTip()

      Provides additional information about the Attribute that aids content managers when setting Product details.

      Specified by:
      getInputTip in interface AttributeDefinitionDraft
      Returns:
      inputTip
    • getInputHint

      public TextInputHint getInputHint()

      Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

      Specified by:
      getInputHint in interface AttributeDefinitionDraft
      Returns:
      inputHint
    • getIsSearchable

      public Boolean getIsSearchable()

      Set to true if the Attribute's values should be available in the Product Projections Search API and can be used in full-text search queries, filters, and facets. 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.

      Specified by:
      getIsSearchable in interface AttributeDefinitionDraft
      Returns:
      isSearchable
    • setType

      public void setType(AttributeType type)
      Description copied from interface: AttributeDefinitionDraft

      Describes the Type of the Attribute.

      When the type is different for an AttributeDefinition using the same name in multiple ProductTypes, an AttributeDefinitionTypeConflict error is returned.

      Specified by:
      setType in interface AttributeDefinitionDraft
      Parameters:
      type - value to be set
    • setName

      public void setName(String name)
      Description copied from interface: AttributeDefinitionDraft

      User-defined name of the Attribute that is unique with the Project.

      When using the same name for 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 an enum or lenum Type and sets thereof.

      Specified by:
      setName in interface AttributeDefinitionDraft
      Parameters:
      name - value to be set
    • setLabel

      public void setLabel(LocalizedString label)
      Description copied from interface: AttributeDefinitionDraft

      Human-readable label for the Attribute.

      Specified by:
      setLabel in interface AttributeDefinitionDraft
      Parameters:
      label - value to be set
    • setIsRequired

      public void setIsRequired(Boolean isRequired)
      Description copied from interface: AttributeDefinitionDraft

      Set to true if the Attribute is required to have a value on a ProductVariant.

      Specified by:
      setIsRequired in interface AttributeDefinitionDraft
      Parameters:
      isRequired - value to be set
    • setAttributeConstraint

      public void setAttributeConstraint(AttributeConstraintEnum attributeConstraint)
      Description copied from interface: AttributeDefinitionDraft

      Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.

      Specified by:
      setAttributeConstraint in interface AttributeDefinitionDraft
      Parameters:
      attributeConstraint - value to be set
    • setInputTip

      public void setInputTip(LocalizedString inputTip)
      Description copied from interface: AttributeDefinitionDraft

      Provides additional information about the Attribute that aids content managers when setting Product details.

      Specified by:
      setInputTip in interface AttributeDefinitionDraft
      Parameters:
      inputTip - value to be set
    • setInputHint

      public void setInputHint(TextInputHint inputHint)
      Description copied from interface: AttributeDefinitionDraft

      Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

      Specified by:
      setInputHint in interface AttributeDefinitionDraft
      Parameters:
      inputHint - value to be set
    • setIsSearchable

      public void setIsSearchable(Boolean isSearchable)
      Description copied from interface: AttributeDefinitionDraft

      Set to true if the Attribute's values should be available in the Product Projections Search API and can be used in full-text search queries, filters, and facets. 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.

      Specified by:
      setIsSearchable in interface AttributeDefinitionDraft
      Parameters:
      isSearchable - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object